2017-05-02 3 views
0

Ich versuche boost 1.57.0 mit gcc 4.0 auf dem Mac zu bauen. Ich fand zuerst this website, aber ich habe eine Anzahl von Linker-Fehlern, als ich das versuchte. Ich habe dann this question gefunden, was mir erlaubt, diese Linker-Fehler zu beheben, aber ich bekomme immer noch mehr, was ich nicht lösen kann. Hier ist ein Ausschnitt der Boost-Build-Ausgabe, der das Problem veranschaulicht.Gebäude-Boost 1.57.0 mit GCC 4.0: ld: can not Map-Datei, 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) 

Ich glaube, etwas stimmt nicht mit den g ++ - Befehlen, aber ich weiß nicht was. Kann jemand das beheben?

Antwort

0

Der Linker, ld wird dazu gebracht zu glauben, dass

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

ist eine Eingabedatei in der Verknüpfung, die es zu lesen. Was es nicht ist; es ist ein Verzeichnis, so dass der Versuch, es als Datei zu lesen, fehlschlägt.

Es geführt wird, dies zu glauben, weil dieses Bit Ihrer g++ Verknüpfung Befehl:

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

es so sagt. Die g++ Option:

-Wl,... 

bedeutet: Pass...quer durch den Linker. So wird der Pfadname an den Linker übergeben. Jeder Pfad in der ld Kommandozeile wird als Name einer Eingabedatei ausgelegt, wenn nicht durch eine Linker-Option Präfix angeben, sonst.

Der gleiche Fehler wird sofort gemacht folgende mit:

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

Es scheint wahrscheinlich, dass Sie g++ sagen wollen, dass die Verzeichnisse

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

diejenigen sind, in denen der Linker-Bibliotheken erforderlich finden können die Verknüpfung. (Zumindest die sehr wahrscheinlich ist, was Sie mit dem ersten wollen. Ich bin nicht so so um die Sekunde).

, das zu tun, übergeben g++ die Optionen:

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

statt.