gavinpugh / vs-android

Integrated development of Android NDK C/C++ software with Microsoft Visual Studio.
Other
119 stars 34 forks source link

Undefined reference, VS2013 #137

Closed powof2 closed 9 years ago

powof2 commented 9 years ago

Thanks for the great tool!.

When i was trying to build an c++ google-play-service tutorial (https://developers.google.com/games/services/downloads/), there are errors saying undefined reference like :

1> d:/Android/gpg-cpp-sdk/android/lib/gnustl/armeabi-v7a/libgpg.a:all.cc:function gpg::AchievementManager::FetchBlocking(gpg::DataSource, std::chrono::duration<long long, std::ratio<1ll, 1000ll> >, std::string const&): error: undefined reference to 'std::chrono::_V2::system_clock::now()'

1> d:/Android/gpg-cpp-sdk/android/lib/gnustl/armeabi-v7a/libgpg.a:all.cc:function gpg::DebugString(gpg::Achievement const&): error: undefined reference to 'std::basic_stringstream<char, std::char_traits, std::allocator >::basic_stringstream(std::_Ios_Openmode)'

is it something about c++11? cause libgpg.a is built with c++11 enabled, and within the visual studio i noticed the macro __cplusplus is 199711L (should be 201103L?)

powof2 commented 9 years ago

It turns out that you have to manually add -lgnustl_static after -lgpg.(not before) at linker/Command line/Additional Options, then everything will be going will.