http://code.google.com/p/twitcurl/wiki/WikiHowToUseTwitcurlLibraryの正確な手順を使用して、twitcurl を使用してコンパイルされた単純な概念実証 C++ アプリケーション ( https://github.com/paulspencerwilliams/CPlusPlusSocialPlaygroundで入手可能) を作成しています。 . 問題なく twitcurl をコンパイルしてインストールでき、Natty Narwhal でアプリケーションをコンパイルして実行できます。ただし、Oneiric Ocelot で (Makefile を使用して) アプリをコンパイルすると、次のリンクの問題が発生します。
g++ -ltwitcurl twitterClient.cpp -o twitterClient
/tmp/ccbxmSF3.o: In function `main':
twitterClient.cpp:(.text+0x1f7): undefined reference to `twitCurl::twitCurl()'
twitterClient.cpp:(.text+0x22e): undefined reference to `twitCurl::setTwitterUsername(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
twitterClient.cpp:(.text+0x247): undefined reference to `twitCurl::setTwitterPassword(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
twitterClient.cpp:(.text+0x280): undefined reference to `twitCurl::getOAuth()'
twitterClient.cpp:(.text+0x292): undefined reference to `oAuth::setConsumerKey(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
twitterClient.cpp:(.text+0x2e9): undefined reference to `twitCurl::getOAuth()'
twitterClient.cpp:(.text+0x2fb): undefined reference to `oAuth::setConsumerSecret(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
twitterClient.cpp:(.text+0x50c): undefined reference to `twitCurl::getOAuth()'
twitterClient.cpp:(.text+0x51e): undefined reference to `oAuth::setOAuthTokenKey(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
twitterClient.cpp:(.text+0x52d): undefined reference to `twitCurl::getOAuth()'
twitterClient.cpp:(.text+0x53f): undefined reference to `oAuth::setOAuthTokenSecret(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
twitterClient.cpp:(.text+0x56c): undefined reference to `twitCurl::oAuthRequestToken(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
twitterClient.cpp:(.text+0x664): undefined reference to `twitCurl::getOAuth()'
twitterClient.cpp:(.text+0x676): undefined reference to `oAuth::setOAuthPin(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
twitterClient.cpp:(.text+0x691): undefined reference to `twitCurl::oAuthHandlePIN(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
twitterClient.cpp:(.text+0x6a0): undefined reference to `twitCurl::oAuthAccessToken()'
twitterClient.cpp:(.text+0x6af): undefined reference to `twitCurl::getOAuth()'
twitterClient.cpp:(.text+0x6c1): undefined reference to `oAuth::getOAuthTokenKey(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
twitterClient.cpp:(.text+0x6d0): undefined reference to `twitCurl::getOAuth()'
twitterClient.cpp:(.text+0x6e2): undefined reference to `oAuth::getOAuthTokenSecret(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
twitterClient.cpp:(.text+0x88e): undefined reference to `twitCurl::statusUpdate(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
twitterClient.cpp:(.text+0x8ab): undefined reference to `twitCurl::getLastWebResponse(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
twitterClient.cpp:(.text+0x8e7): undefined reference to `twitCurl::getLastCurlError(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
twitterClient.cpp:(.text+0x97e): undefined reference to `twitCurl::timelineUserGet(bool, bool, unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool)'
twitterClient.cpp:(.text+0x9bb): undefined reference to `twitCurl::getLastWebResponse(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
twitterClient.cpp:(.text+0x9f7): undefined reference to `twitCurl::getLastCurlError(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
twitterClient.cpp:(.text+0xa86): undefined reference to `twitCurl::~twitCurl()'
twitterClient.cpp:(.text+0xc64): undefined reference to `twitCurl::~twitCurl()'
collect2: ld returned 1 exit status
make: *** [all] Error 1
これら2つのプラットフォームでのコンパイルの違いは何ですか? 正確な比較のために、AWS の Ubuntu 64 ビット イメージでこれを試してみましたが、同じ症状が発生しました。
Edit: I've changed the order of parameters in my Makefile, and it no seems to get past the first issue. However, I'm now presented with the following error when compiling:
g++ twitterClient.cpp -o twitterClient -ltwitcurl
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libtwitcurl.so: undefined reference to `curl_easy_getinfo'
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libtwitcurl.so: undefined reference to `curl_easy_setopt'
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libtwitcurl.so: undefined reference to `curl_easy_init'
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libtwitcurl.so: undefined reference to `curl_slist_append'
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libtwitcurl.so: undefined reference to `curl_slist_free_all'
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libtwitcurl.so: undefined reference to `curl_easy_perform'
/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/libtwitcurl.so: undefined reference to `curl_easy_cleanup'
collect2: ld returned 1 exit status
make: *** [all] Error 1