2017-05-02 8 views
0

Macでgcc 4.0を使って1.57.0のブーストを構築しようとしています。私は最初にthis websiteを見つけましたが、私はそれを試みたときにリンカのエラーの数を得ました。私はthis questionを見つけたので、それらのリンカエラーを修正することができましたが、私はまだ解決できないほど多くを得ています。ここに、問題を示すブーストビルド出力のスニペットがあります。GCC 4.0でビルド1.57.0をビルドする:ld:ファイルをマップできません、errno = 22

...failed gcc.compile.c++ bin.v2/libs/context/build/gcc-4.0.1/release/threading-multi/unsupported.o... 
...skipped <p/boost_1_57_0/lib>libboost_context.dylib for lack of <pbin.v2/libs/context/build/gcc-4.0.1/release/threading-multi>unsupported.o... 
gcc.link.dll /boost_1_57_0/lib/libboost_thread.dylib 
ld: can't map file, errno=22 file '/System/Library/Frameworks/Python.framework/Versions/2.7/lib' for architecture x86_64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

    "g++" -Wl,"/System/Library/Frameworks/Python.framework/Versions/2.7/lib" -Wl,"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config" -o "/boost_1_57_0/lib/libboost_thread.dylib" -shared "bin.v2/libs/thread/build/gcc-4.0.1/release/threading-multi/pthread/thread.o" "bin.v2/libs/thread/build/gcc-4.0.1/release/threading-multi/pthread/once.o" "bin.v2/libs/thread/build/gcc-4.0.1/release/threading-multi/future.o" "bin.v2/libs/system/build/gcc-4.0.1/release/threading-multi/libboost_system.dylib" "bin.v2/libs/atomic/build/gcc-4.0.1/release/threading-multi/libboost_atomic.dylib"   

...failed gcc.link.dll /boost_1_57_0/lib/libboost_thread.dylib... 
...skipped <pbin.v2/libs/context/build/gcc-4.0.1/release/threading-multi>libboost_context.dylib for lack of <pbin.v2/libs/context/build/gcc-4.0.1/release/threading-multi>unsupported.o... 
...skipped <p/boost_1_57_0/lib>libboost_coroutine.dylib for lack of <pbin.v2/libs/context/build/gcc-4.0.1/release/threading-multi>libboost_context.dylib... 
gcc.link.dll /boost_1_57_0/lib/libboost_date_time.dylib 
ld: can't map file, errno=22 file '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config' for architecture x86_64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

    "g++" -Wl,"/System/Library/Frameworks/Python.framework/Versions/2.7/lib" -Wl,"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config" -o "/boost_1_57_0/lib/libboost_date_time.dylib" -shared "bin.v2/libs/date_time/build/gcc-4.0.1/release/threading-multi/gregorian/greg_month.o" "bin.v2/libs/date_time/build/gcc-4.0.1/release/threading-multi/gregorian/greg_weekday.o" "bin.v2/libs/date_time/build/gcc-4.0.1/release/threading-multi/gregorian/date_generators.o"   

...failed gcc.link.dll /boost_1_57_0/lib/libboost_date_time.dylib... 
gcc.link.dll /boost_1_57_0/lib/libboost_filesystem.dylib 
ld: can't map file, errno=22 file '/System/Library/Frameworks/Python.framework/Versions/2.7/lib' for architecture x86_64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

g ++コマンドで何かが間違っていると思いますが、わかりません。誰もがこれを修正する方法を知っていますか?

答えて

0

リンカ、ld

/System/Library/Frameworks/Python.framework/Versions/2.7/lib 

はそれが読まなければならないことに連動して、入力ファイルであることを信じるように導かれています。それはない。 これはディレクトリなので、ファイルとして読み込もうとすると失敗します。

あなたg++連携コマンドのこのビットので、これを信じるように導かれています:

-Wl,"/System/Library/Frameworks/Python.framework/Versions/2.7/lib" 

はので、それを伝えます。 g++オプション:

-Wl,... 

は意味:ストレートリンカに通じパス...を。したがって、パス名はリンカーに を渡します。 ldコマンドラインの任意のパス名は、任意のリンカーオプションによって接頭辞が付けられていない場合、入力ファイルの名前として と解釈され、それ以外の場合は となります。同じエラーはすぐに次のよう作られて

-Wl,"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config" 

あなたがディレクトリ

/System/Library/Frameworks/Python.framework/Versions/2.7/lib 
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config 

は、リンカがで必要なライブラリを見つけることが可能なものであることをg++を伝えたいと思わリンケージ。 (少なくとも、 最初のもので欲しいと思っている可能性が非常に高いです。私は 秒についてそうではありません)。代わりに

-L/System/Library/Frameworks/Python.framework/Versions/2.7/lib -L/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/config 

g++オプションを渡す、それを行うために

関連する問題