ブーストシリアル化を使用しています。私は次のようにコンパイルしました:-L/opt/local/lib -lboost_serialization -stdlib=libc++
、しかしいくつかの(不可解な)エラーが発生しました:
アーキテクチャx86_64の未定義のシンボル: "boost :: archive :: text_oarchive_impl :: save(std :: __ 1 :: basic_string、std :: __ 1 :: allocator> const&)"、参照元: void boost :: archive :: save_access :: save_primitive、std :: __ 1 :: allocator >>(boost :: archive :: text_oarchive&、std :: __ 1 :: basic_string、std :: __ 1 :: allocator> const&) .o "boost :: archive :: basic_text_oprimitive >> ::〜basic_text_oprimitive()"、参照元: main.oのboost::archive :: text_oarchive_impl ::〜text_oarchive_impl() "boost :: archive :: text_oarchive_impl :: text_oarchive_impl(std :: __ 1 :: basic_ostream>&、unsigned int)"、参照元: main.oのboost::archive :: text_oarchive :: text_oarchive(std :: __ 1 :: basic_ostream>&、unsigned int) ld:アーキテクチャx86_64のシンボルが見つかりません
私はシリアル化していstd::vector<std::string>
ます:
boost::archive::text_oarchive oa(std::cout);
oa << tasks;
Boostのインストールに問題はありますか?
Boostライブラリは、32ビットと64ビットの両方のマシンコードを含むユニバーサルバイナリです(これは私が推測する問題ではありません)。
$ファイルlibboost_serialization.dylib libboost_serialization.dylib:2つのアーキテクチャを備えたMach-Oユニバーサルバイナリ libboost_serialization.dylib(アーキテクチャi386用):Mach-O動的リンク共有ライブラリi386 libboost_serialization.dylib(アーキテクチャx86_64用):Mach-O64ビット動的リンク共有ライブラリx86_64
sudo port install boost +universal
Mac OSX10.7を使用してboostをインストールしました。