2014-04-14 16 views
0

我明白什麼是未解決的符號錯誤,但我不明白爲什麼我在這個特定的圖書館在這種特殊情況下得到它。這是錯誤的輸出。與社會圖書館未解決的符號錯誤

Undefined symbols for architecture x86_64: 
    "soci::soci_error::soci_error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from: 
     soci::type_conversion<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, void>::from_base(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, soci::indicator, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&) in Inspector.o 
ld: symbol(s) not found for architecture x86_64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

請注意,我使用下面的鏈接標誌:

-L/usr/local/lib -lsoci_core -lsoci_postgresql -lpq -ldl 

還要注意與其他符號(例如,在soci::session構造函數和析構函數)引用正在被解決。

我在做什麼錯?我還應該鏈接另一個社會圖書館嗎?

編輯:請注意,我的工作在Mac OS X,並試圖通過二者的自制軟件安裝(通過brew install soci --with-pg),以及3.2.2和3.2.1的獨立安裝。

回答

0

我不知道爲什麼這解決了錯誤,但從libC++更改爲libstdC++解決了它。