2017-05-02 13 views
0

Mac에서 gcc 4.0으로 부스트 1.57.0을 빌드하려고합니다. 나는 처음에 this website을 발견했지만, 나는 그것을 시도했을 때 많은 링커 오류가있다. 그런 다음 this question에서 링커 오류를 해결할 수 있었지만 여전히 해결할 수없는 부분이 많습니다. 다음은 문제를 보여주는 boost 빌드 출력 코드입니다.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 

이 읽기해야하는 연결의 입력 파일임을 믿게되고있다. 어느 쪽이 아닌가. 디렉토리이므로 파일로 읽으려는 시도가 실패합니다.

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

그래서를 알려줍니다

는 당신의 g++ 연결 명령이 비트가 있기 때문에이 믿게되는 것. 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++을 말하고 싶은 것으로 보인다 연결. (적어도 은 첫 번째로 원하는 것일 가능성이 매우 높습니다. 초에 대해서는별로 그렇게 생각하지 않습니다.)

는 그렇게 g++ 옵션을 전달하려면 : 대신

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

합니다.