簡體   English   中英

在XCode 4.5.2 C ++項目中鏈接boost序列化靜態庫

[英]linking boost serialisation static library in XCode 4.5.2 c++ project

我正在Mac OSX 10.8(Mountain Lion)上構建應用程序,並且遇到與Boost庫(serialisation.a)有關的鏈接錯誤。 我在同一項目中使用了其他Boost二進制文件,並且它們沒有引發任何問題,所以我非常有信心自己已經正確構建了庫(我選擇為Darwin工具集構建整個庫) 。 出於同樣的原因,我對我的鏈接器路徑設置正確很有信心。 我知道這個列表上沒有很多Mac開發人員,但是我想知道是否有人可以提供任何建議。 該項目由XCode 4.5.2處理,並使用GCC 4.2編譯器。 以下是構建的輸出(我只包含了第一個錯誤-其余所有都是主題的變體,並且都引用了Boost :: archive或Boost :: serialisation(兩者都包含在Boost序列化中) .a靜態庫文件)。

Ld /Users/tim/Library/Developer/Xcode/DerivedData/SurfaceReader-fwryryuvfvwihnglkuymbbjtxpac/Build/Products/Debug/SurfaceReader.app/Contents/MacOS/SurfaceReader normal x86_64
    cd /Users/tim/Developer/SurfaceReader
    setenv MACOSX_DEPLOYMENT_TARGET 10.8
    /Applications/Xcode.app/Contents/Developer/usr/bin/llvm-g++-4.2 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk -L/Users/tim/Library/Developer/Xcode/DerivedData/SurfaceReader-fwryryuvfvwihnglkuymbbjtxpac/Build/Products/Debug -L/users/tim/developer/libraries/boost_1_50_0/lib -L/users/tim/developer/libraries/cryptopp561 -F/Users/tim/Library/Developer/Xcode/DerivedData/SurfaceReader-fwryryuvfvwihnglkuymbbjtxpac/Build/Products/Debug -filelist /Users/tim/Library/Developer/Xcode/DerivedData/SurfaceReader-fwryryuvfvwihnglkuymbbjtxpac/Build/Intermediates/SurfaceReader.build/Debug/SurfaceReader.build/Objects-normal/x86_64/SurfaceReader.LinkFileList -mmacosx-version-min=10.8 -L/Users/tim/developer/libraries/wxwidgets-2.9.4/build-debug/lib -framework IOKit -framework Carbon -framework Cocoa -framework AudioToolbox -framework System -framework OpenGL /Users/tim/developer/libraries/wxwidgets-2.9.4/build-debug/lib/libwx_osx_cocoau_xrc-2.9.a /Users/tim/developer/libraries/wxwidgets-2.9.4/build-debug/lib/libwx_osx_cocoau_webview-2.9.a /Users/tim/developer/libraries/wxwidgets-2.9.4/build-debug/lib/libwx_osx_cocoau_qa-2.9.a /Users/tim/developer/libraries/wxwidgets-2.9.4/build-debug/lib/libwx_baseu_net-2.9.a /Users/tim/developer/libraries/wxwidgets-2.9.4/build-debug/lib/libwx_osx_cocoau_html-2.9.a /Users/tim/developer/libraries/wxwidgets-2.9.4/build-debug/lib/libwx_osx_cocoau_adv-2.9.a /Users/tim/developer/libraries/wxwidgets-2.9.4/build-debug/lib/libwx_osx_cocoau_core-2.9.a /Users/tim/developer/libraries/wxwidgets-2.9.4/build-debug/lib/libwx_baseu_xml-2.9.a /Users/tim/developer/libraries/wxwidgets-2.9.4/build-debug/lib/libwx_baseu-2.9.a -framework WebKit -lexpat -lwxregexu-2.9 -lwxtiff-2.9 -lwxjpeg-2.9 -lwxpng-2.9 -lz -lpthread -liconv -stdlib=libc++ -fobjc-arc -fobjc-link-runtime -framework CoreMIDI -framework CoreAudio -framework Cocoa -lboost_filesystem -lboost_iostreams -lboost_serialization -lboost_system -lcryptopp -o /Users/tim/Library/Developer/Xcode/DerivedData/SurfaceReader-fwryryuvfvwihnglkuymbbjtxpac/Build/Products/Debug/SurfaceReader.app/Contents/MacOS/SurfaceReader

Undefined symbols for architecture x86_64:

  "boost::archive::basic_xml_iarchive<boost::archive::xml_wiarchive>::load_start(char const*)", referenced from:
      void boost::archive::basic_xml_iarchive<boost::archive::xml_wiarchive>::load_override<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > >(boost::serialization::nvp<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > const&, int)in SurfaceFrame.o

Apple LLVM標准編譯器4.2-語言 / C ++標准庫設置從libc ++(LLVM)更改為libstdc ++(GNU)對我來說解決了相同的情況。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM