Building SFML and V8 - sfml

I'm trying to use SFML as my graphics backbone for a C++ game engine. I'm also using the V8 JavaScript engine. The problem is, to get V8 to compile, I've got to use -stdlib=libstdc++, and to get SFML to compile, I've got to use -stdlib=libc++. Obviously, I can't use both, so how can I work around this?
I'm using Xcode on a Mac Mini, by the way, but it doesn't work through the terminal either.
SFML gives me these errors when using -stdlib=libstdc++:
Undefined symbols for architecture x86_64:
"sf::String::String(char const*, std::locale const&)", referenced from:
And V8 gives me these errors when using -stdlib=libc++:
Undefined symbols for architecture x86_64:
"std::_Rb_tree_decrement(std::_Rb_tree_node_base*)", referenced from:
std::_Rb_tree<unsigned char*, std::pair<unsigned char* const, v8::internal::AddressToTraceMap::RangeStack>, std::_Select1st<std::pair<unsigned char* const, v8::internal::AddressToTraceMap::RangeStack> >, std::less<unsigned char*>, std::allocator<std::pair<unsigned char* const, v8::internal::AddressToTraceMap::RangeStack> > >::_M_insert_unique(std::pair<unsigned char* const, v8::internal::AddressToTraceMap::RangeStack> const&) in libv8_base.x64.a(allocation-tracker.o)
"std::_Rb_tree_increment(std::_Rb_tree_node_base*)", referenced from:
v8::internal::AddressToTraceMap::RemoveRange(unsigned char*, unsigned char*) in libv8_base.x64.a(allocation-tracker.o)
v8::internal::AddressToTraceMap::Print() in libv8_base.x64.a(allocation-tracker.o)
"std::__throw_length_error(char const*)", referenced from:
std::vector<v8::internal::WorkerThread*, std::allocator<v8::internal::WorkerThread*> >::_M_insert_aux(__gnu_cxx::__normal_iterator<v8::internal::WorkerThread**, std::vector<v8::internal::WorkerThread*, std::allocator<v8::internal::WorkerThread*> > >, v8::internal::WorkerThread* const&) in libv8_base.x64.a(default-platform.o)
"std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
v8::internal::AddressToTraceMap::RemoveRange(unsigned char*, unsigned char*) in libv8_base.x64.a(allocation-tracker.o)
"std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
std::_Rb_tree<unsigned char*, std::pair<unsigned char* const, v8::internal::AddressToTraceMap::RangeStack>, std::_Select1st<std::pair<unsigned char* const, v8::internal::AddressToTraceMap::RangeStack> >, std::less<unsigned char*>, std::allocator<std::pair<unsigned char* const, v8::internal::AddressToTraceMap::RangeStack> > >::_M_insert_unique(std::pair<unsigned char* const, v8::internal::AddressToTraceMap::RangeStack> const&) in libv8_base.x64.a(allocation-tracker.o)

You need to recompile SFML and/or V8 with the same std lib since they are not compatible. I don't know for V8 but SFML should be able to work with libstdc++ too (set CMAKE_CXX_FLAGS and CMAKE_C_FLAGS to -stdlib=libstdc++ when generating the makefile). You won't be able to use C++11 features with libstdc++, though.

Related

Googletest: CLANG compiles where GCC fails

Here is a very simple script using gtest (saved in file gt.cpp)
#include<gtest/gtest.h>
double timesTwo(double x){return x*2;}
TEST(testTimesTwo, integerTests){EXPECT_EQ(6, timesTwo(3));}
int main(int argc, char* argv[]){
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
The script compiles fine with CLANG (Apple clang version 11.0.3)
clang++ -std=c++17 -lgtest gt.cpp -o gt
but fails with GCC (g++ (GCC) 10.2.0)
g++ -std=c++17 -lgtest gt.cpp -o gt
gt.cpp:2:9: fatal error: gtest/gtest.h: No such file or directory
2 | #include<gtest/gtest.h>
|
Using the -H option in CLANG, I see the header file is included from /usr/local/include. Also, I can find the libgtest.a file in /usr/local/bin/. So, I did
g++ -std=c++17 gt.cpp -o gt -I/usr/local/include/ -L/usr/local/lib/ -lgtest
and got a long list of undefined symbols starting with
Macavity:test remi$ g++ -std=c++17 gt.cpp -o gt -I/usr/local/include/ -L/usr/local/lib/ -lgtest
Undefined symbols for architecture x86_64:
"__ZN7testing8internal9EqFailureEPKcS2_RKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESA_b", referenced from:
__ZN7testing8internal18CmpHelperEQFailureIidEENS_15AssertionResultEPKcS4_RKT_RKT0_ in ccrUwUPO.o
"__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4findEcm", referenced from:
__ZN7testing8internal11SplitStringERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEEcPNS1_6vectorIS7_NS5_IS7_EEEE in libgtest.a(gtest-all.cc.o)
__ZN7testing8internalL21FormatDeathTestOutputERKNSt3__112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE in libgtest.a(gtest-all.cc.o)
"__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7compareEmmPKcm", referenced from:
Can you help me figure out why GCC fails to compile here?
Here is this error message passed through a http://demangler.com/
Undefined symbols for architecture x86_64:
"_testing::internal::EqFailure(char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, bool)", referenced from:
_testing::AssertionResult testing::internal::CmpHelperEQFailure<int, double>(char const*, char const*, int const&, double const&) in ccrUwUPO.o
"_std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::find(char, unsigned long) const", referenced from:
_testing::internal::SplitString(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, char, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*) in libgtest.a(gtest-all.cc.o)
_testing::internal::FormatDeathTestOutput(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) in libgtest.a(gtest-all.cc.o)
"_std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::compare(unsigned long, unsigned long, char const*, unsigned long) const", referenced from:
Note that second and third error complains that linker can't find implementation of: std::string::find(char, unsigned long) and std::string::compare(unsigned long, unsigned long, char const*, unsigned long) const.
Those are parts of standard C++ library. Since std::string is template some parts of it are part of library which uses that template, but is some cases it can be part of C++ runtime.
Now I suspect that you compiled gtest with a clang and try use it when building test with gcc (or vice versa). A bit different implementations of std::string on both compilers lead to divergence in available symbols.
So please make sure that gtest and test application are build with same compiler.
Here is some description of binary compatibility between gcc and clang. There are some hints what problem is, but it is not very formal (maybe I will find better document).

CMake: Make a static library works but dynamic doesn't

I am trying to make a shared library using CMake, but its wired that if I make it statically, it works well, but dynamic doesn't:
CMAKE_MINIMUM_REQUIRED(VERSION 3.6)
PROJECT(TestDemo)
SET(CMAKE_CXX_STANDARD 11)
SET(CMAKE_CXX_COMPILER clang++)
# Headers
INCLUDE_DIRECTORIES(src)
INCLUDE_DIRECTORIES(src/xxx)
INCLUDE_DIRECTORIES(3rdparty/zstd)
INCLUDE_DIRECTORIES(/usr/local/include)
# CORE LIB
FILE(GLOB CORE_SRC src/xxx/*.cpp
src/xxx/io/*.cpp
src/xxx/util/*.cpp
src/xxx/thread/*.cpp)
LIST(REMOVE_ITEM CORE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/xxx/io/BzipStream.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/xxx/io/GzipStream.cpp)
# This works
ADD_LIBRARY(xxx-core STATIC ${CORE_SRC})
# This doesn't
#ADD_LIBRARY(xxx-core SHARED ${CORE_SRC})
The error message is:
[100%] Linking CXX shared library libxxxdb-core.dylib
Undefined symbols for architecture x86_64:
"_mpool_get_global", referenced from:
xxx::mpoolxx<xxx::alloc_to_mpool_bridge<xxx::mpoolxx<long>, 1>::MemBlock>::get_vtab() in trb_cxx.cpp.o
"_sfixed_mpool_destroy", referenced from:
xxx::fixed_mpool_wrapper<24>::~fixed_mpool_wrapper() in trb_cxx.cpp.o
"_sfixed_mpool_init", referenced from:
xxx::fixed_mpool_wrapper<24>::fixed_mpool_wrapper() in trb_cxx.cpp.o
"_trb_destroy", referenced from:
xxx::trbstrmap_imp<int, unsigned char, &(xxx_trb_compare_less_tag), xxx::mpoolxx<long>, 0, 16>::~trbstrmap_imp() in trb_cxx.cpp.o
xxx::trbtab<int const, std::__1::pair<int const, int>, 0, &(xxx_trb_compare_less_tag), xxx::fixed_mpoolxx<long>, 0, 16>::~trbtab() in trb_cxx.cpp.o
"_trb_erase", referenced from:
xxx::trbtab<int const, std::__1::pair<int const, int>, 0, &(xxx_trb_compare_less_tag), xxx::fixed_mpoolxx<long>, 0, 16>::erase(int const&) in trb_cxx.cpp.o
xxx::trbtab<int const, std::__1::pair<int const, int>, 0, &(xxx_trb_compare_less_tag), xxx::fixed_mpoolxx<long>, 0, 16>::erase(xxx::trb_iterator<std::__1::pair<int const, int>, 16, 0>) in trb_cxx.cpp.o
"_trb_iter_first", referenced from:
xxx::trbtab<int const, std::__1::pair<int const, int>, 0, &(xxx_trb_compare_less_tag), xxx::fixed_mpoolxx<long>, 0, 16>::begin() const in trb_cxx.cpp.o
"_trb_iter_next", referenced from:
xxx::trb_iterator<std::__1::pair<int const, int>, 16, 0>::operator++() in trb_cxx.cpp.o
"_trb_probe", referenced from:
xxx::trbtab<int const, std::__1::pair<int const, int>, 0, &(xxx_trb_compare_less_tag), xxx::fixed_mpoolxx<long>, 0, 16>::insert(std::__1::pair<int const, int> const&) in trb_cxx.cpp.o
xxx::trbmap<int, int, &(xxx_trb_compare_less_tag), xxx::fixed_mpoolxx<long>, 0, 16>::operator[](int const&) in trb_cxx.cpp.o
"_trb_probe_node", referenced from:
xxx::trbstrmap_imp<int, unsigned char, &(xxx_trb_compare_less_tag), xxx::mpoolxx<long>, 0, 16>::probe_raw(char const*, unsigned long, char const*) in trb_cxx.cpp.o
"_trb_vtab_init", referenced from:
xxx::trbxx_vtab_init_by_cxx_type(trb_vtab*, field_type_t, int (*)(trb_vtab const*, trb_tree const*, void const*, void const*), int (*)(trb_vtab const*, trb_tree const*, void const*, void const*)) in trb_cxx.cpp.o
xxx::trbxx_vtab_init(trb_vtab*, field_type_t, int (*)(trb_vtab const*, trb_tree const*, void const*, void const*)) in trb_cxx.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
No linkage happens in the creation of a static library because a static library
is not produced by the linker: it is simply an archive of object files created
with the archiver ar. So there can't
be any undefined references or other linkage errors when you create a static library,
just like there can't be if you create a .tar or .zip archive of object files.
See static-libraries,
A shared library, like a program, is produced by the linker and the Mac OS/Darwin
linker (unlike the GNU/Linux linker) by default does not permit undefined symbol
references in a shared library.
You have two options:
You can specify all the libraries that xxx-core depends upon to its linkage,
with target_link_libraries
Or, you can override the linker's default behaviour with the linkage option
-undefined=dynamic_lookup, indicating
that undefined references in the shared library are to be resolved by the loader at runtime.
In your CMakeLists.txt, use set_target_properties
after you have defined the xxx-core target:
ADD_LIBRARY(xxx-core SHARED ${CORE_SRC})
SET_TARGET_PROPERTIES(xxx-core LINK_FLAGS Wl,-undefined=dynamic_lookup)

Linker error trying to embed v8

I am trying to make a simple program where I embed Google's V8 Javascript engine. The instructions seem straight forward, but I'm getting an odd link error.
I'm on Mac OS X 10.9, and I'm using Xamarin Studio as my IDE which appears to be using g++ as the compiler.
I compiled v8 using the instructions on their site. Specifically, after all the make dependencies, I ran:
make x64.release
This appeared to complete successfully.
Here's the output I'm getting when I try to build my project:
g++ -o "/Users/mike/Projects/vate/vate/bin/Debug/vate" "/Users/mike/Projects/vate/vate/bin/Debug/hello_world.o" -v -L"/Users/mike/Projects/v8/xcodebuild/Debug" -l"icudata" -l"icui18n" -l"v8_snapshot" -l"icuuc" -l"v8_libbase" -l"v8_base" -l"v8_libplatform"
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.9.0 -o /Users/mike/Projects/vate/vate/bin/Debug/vate -L/Users/mike/Projects/v8/xcodebuild/Debug /Users/mike/Projects/vate/vate/bin/Debug/hello_world.o -licudata -licui18n -lv8_snapshot -licuuc -lv8_libbase -lv8_base -lv8_libplatform -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/5.1/lib/darwin/libclang_rt.osx.a
Undefined symbols for architecture x86_64:
"std::string::c_str() const", referenced from:
v8::internal::Logger::SharedLibraryEvent(std::string const&, unsigned long, unsigned long) in libv8_base.a(log.o)
"std::allocator::allocator()", referenced from:
v8::base::OS::GetSharedLibraryAddresses() in libv8_libbase.a(platform-macos.o)
"std::allocator::~allocator()", referenced from:
v8::base::OS::GetSharedLibraryAddresses() in libv8_libbase.a(platform-macos.o)
"std::basic_string, std::allocator >::basic_string(char const*, std::allocator const&)", referenced from:
v8::base::OS::GetSharedLibraryAddresses() in libv8_libbase.a(platform-macos.o)
"std::basic_string, std::allocator >::basic_string(std::string const&)", referenced from:
v8::base::OS::SharedLibraryAddress::SharedLibraryAddress(v8::base::OS::SharedLibraryAddress const&) in libv8_libbase.a(platform-macos.o)
v8::base::OS::SharedLibraryAddress::SharedLibraryAddress(std::string const&, unsigned long, unsigned long) in libv8_libbase.a(platform-macos.o)
"std::basic_string, std::allocator >::~basic_string()", referenced from:
v8::base::OS::SharedLibraryAddress::~SharedLibraryAddress() in libv8_base.a(log.o)
v8::base::OS::GetSharedLibraryAddresses() in libv8_libbase.a(platform-macos.o)
v8::base::OS::SharedLibraryAddress::~SharedLibraryAddress() in libv8_libbase.a(platform-macos.o)
"std::string::operator=(std::string const&)", referenced from:
v8::base::OS::SharedLibraryAddress::operator=(v8::base::OS::SharedLibraryAddress const&) in libv8_libbase.a(platform-macos.o)
"std::_Rb_tree_decrement(std::_Rb_tree_node_base*)", referenced from:
std::_Rb_tree_iterator >::operator--() in libv8_base.a(allocation-tracker.o)
std::_Rb_tree_iterator >::operator--() in libv8_base.a(lithium-codegen.o)
std::_Rb_tree_iterator::operator--() in libv8_base.a(verifier.o)
std::_Rb_tree_iterator::operator--() in libv8_base.a(instruction.o)
std::_Rb_tree_iterator >::operator--() in libv8_base.a(instruction-selector.o)
std::_Rb_tree_iterator::operator--() in libv8_base.a(typer.o)
std::_Rb_tree_iterator::operator--() in libv8_base.a(graph-visualizer.o)
...
"std::_Rb_tree_increment(std::_Rb_tree_node_base const*)", referenced from:
std::_Rb_tree_const_iterator >::operator++() in libv8_base.a(lithium.o)
std::_Rb_tree_const_iterator::operator++() in libv8_base.a(verifier.o)
std::_Rb_tree_const_iterator >::operator++() in libv8_base.a(instruction.o)
std::_Rb_tree_const_iterator::operator++() in libv8_base.a(typer.o)
std::_Rb_tree_const_iterator::operator++() in libv8_base.a(graph-visualizer.o)
"std::_Rb_tree_increment(std::_Rb_tree_node_base*)", referenced from:
std::_Rb_tree_iterator >::operator++() in libv8_base.a(allocation-tracker.o)
std::_Rb_tree_iterator >::operator++(int) in libv8_base.a(allocation-tracker.o)
"std::__throw_length_error(char const*)", referenced from:
std::vector >::_M_insert_aux(__gnu_cxx::__normal_iterator > >, v8::base::OS::SharedLibraryAddress const&) in libv8_libbase.a(platform-macos.o)
std::vector >::_M_insert_aux(__gnu_cxx::__normal_iterator > >, v8::internal::compiler::Reducer* const&) in libv8_base.a(pipeline.o)
std::vector >::_M_fill_insert(__gnu_cxx::__normal_iterator > >, unsigned long, v8::internal::compiler::Node* const&) in libv8_base.a(ast-graph-builder.o)
std::vector >::_M_insert_aux(__gnu_cxx::__normal_iterator > >, v8::internal::compiler::Node* const&) in libv8_base.a(ast-graph-builder.o)
std::vector >::_M_insert_aux(__gnu_cxx::__normal_iterator > >, v8::internal::compiler::FrameStateDescriptor* const&) in libv8_base.a(instruction.o)
std::vector >::_M_insert_aux(__gnu_cxx::__normal_iterator > >, v8::internal::compiler::Node* const&) in libv8_base.a(simplified-lowering.o)
std::vector >::reserve(unsigned long) in libv8_base.a(instruction-selector.o)
...
"std::__throw_out_of_range(char const*)", referenced from:
std::vector >::_M_range_check(unsigned long) const in libv8_base.a(graph-reducer.o)
std::vector >::_M_range_check(unsigned long) const in libv8_base.a(ast-graph-builder.o)
std::vector >::_M_range_check(unsigned long) const in libv8_base.a(verifier.o)
std::vector >::_M_range_check(unsigned long) const in libv8_base.a(verifier.o)
std::vector >::_M_range_check(unsigned long) const in libv8_base.a(graph-replay.o)
std::vector >::_M_range_check(unsigned long) const in libv8_base.a(js-context-specialization.o)
std::vector >::_M_range_check(unsigned long) const in libv8_base.a(graph-builder.o)
...
"std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::erase(std::_Rb_tree_iterator >) in libv8_base.a(allocation-tracker.o)
"std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&)", referenced from:
std::_Rb_tree, std::_Select1st >, std::less, std::allocator > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair const&) in libv8_base.a(allocation-tracker.o)
std::_Rb_tree, v8::internal::Handle, std::_Identity >, std::less >, v8::internal::zone_allocator > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, v8::internal::Handle const&) in libv8_base.a(lithium-codegen.o)
std::_Rb_tree, std::less, v8::internal::zone_allocator >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, v8::internal::compiler::Node* const&) in libv8_base.a(verifier.o)
std::_Rb_tree, std::less, v8::internal::zone_allocator >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, int const&) in libv8_base.a(instruction.o)
std::_Rb_tree, std::_Select1st >, std::less, v8::internal::zone_allocator > >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::pair const&) in libv8_base.a(instruction-selector.o)
std::_Rb_tree, std::less, v8::internal::zone_allocator >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, v8::internal::compiler::Node* const&) in libv8_base.a(typer.o)
std::_Rb_tree, std::less, v8::internal::zone_allocator >::_M_insert(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, v8::internal::compiler::Node* const&) in libv8_base.a(graph-visualizer.o)
...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have a feeling that I compiled v8 wrong, or perhaps for a different compiler, but I can't find any way to customize that. Has anyone else seen this?
I have figured it out. I had two problems:
I was confused about which compiler I was actually using. On OSX, g++ is actually symlinked to clang++, so I needed to compile V8 using the Clang conventions, not g++
The instructions on compiling with clang on Google's page are incorrect, per this bug: https://code.google.com/p/v8/issues/detail?id=3072
For reference, to compile with clang, you need to configure your environment like this:
export CXX=`which clang++`
export CC=`which clang`
export CPP="`which clang` -E -std=c++11 -stdlib=libc++"
export LINK="`which clang++` -std=c++11 -stdlib=libc++"
export CXX_host=`which clang++`
export CC_host=`which clang`
export CPP_host="`which clang` -E"
export LINK_host=`which clang++`
export GYP_DEFINES="clang=1 mac_deployment_target=10.9"
You can then run your make whatever command as normal.
Obviously, requires that xcode be installed so that clang and clang++ exist.

Undefined reference to boost::locale:conv::between

I am trying to follow the answer to my previous question and use boost::locale::conv::between to get a UTF-8 string from vector<char> containing UTF-16 data. My code is pretty much as in the answer (with some differences in how I get the char *:
char in[length + 1];
//... populate in with my source data
in[length] = '\0';
std::string out = boost::locale::conv::between((const char*)in, std::string("UTF-8"), std::string("UTF-16"));
This compiles fine, but during linking I get error
In function `boost::locale::conv::between(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::locale::conv::method_type)':
/usr/local/include/boost/locale/encoding.hpp:186: undefined reference to `boost::locale::conv::between(char const*, char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, boost::locale::conv::method_type)'
This doesn't look right to me. On possibility I could think of is that I had boost 1.50 installed, so I installed latest 1.55 release - yet I get the same error.
Boost locale is not a header-only library, it has an actual library that you need to link with.
Adding following flag to LDFLAGS helps:
-lboost_locale
I have encountered the same problem. I think you should use the dynamic library instead of the static library.

Apple Mach-O Linker (Id) Error in xcode

I am using xcode to work with SNAP package (http://memetracker.org).
When I Build, I get a few "Apple Mach-O Linker (Id) Error"
I read that I may have to add the right framework but I do not know how I can find what the right framework is.
Undefined symbols for architecture x86_64:
"_Env", referenced from:
_main in cliquesmain.o
"ExeStop(char const*, char const*, char const*, char const*, int const&)", referenced from:
TPt<TUNGraph>::operator->() const in cliquesmain.o
TVec<TVec<TInt, int>, int>::operator[](int const&) in cliquesmain.o
TVec<TInt, int>::operator[](int const&) in cliquesmain.o
TPt<TExcept>::operator->() const in cliquesmain.o
TRStr::GetNullRStr() in cliquesmain.o
TRStr::~TRStr() in cliquesmain.o
TVec<TInt, int>::operator[](int const&) const in cliquesmain.o
...
"WrNotify(char const*, char const*)", referenced from:
ErrNotify(char const*) in cliquesmain.o
"TCliqueOverlap::GetCPMCommunities(TPt<TUNGraph> const&, int, TVec<TVec<TInt, int>, int>&)", referenced from:
_main in cliquesmain.o
.....
Have you added this memetracker "library" correctly? Check out the tab "build phases", if not then there is probably your problem.
I assume you have the code/library in your project, so you have auto-completion, but to link this library you need to specify where to find it.