2012-07-21 5 views
0

저는 책을 읽었지 만이 코드로 컴파일하는 동안 하나의 오류가 발생합니다. 나는 특히이 라인에서 몇 가지 문제를했습니다-fPIC 옵션을 컴파일하는 동안 Gcc 오류가 발생했습니다.

$ rm -f injection.dylib 
$ export PLATFORM=/Developer/Platforms/iPhoneOS.platform 
$ $PLATFORM/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 \ 
-c -o injection.o injection.c \ 
-isysroot $PLATFORM/Developer/SDKs/iPhoneOS5.0.sdk \ -fPIC 
$ $PLATFORM/Developer/usr/bin/ld \ -dylib -lsystem -lobjc \ 
-o injection.dylib injection.o \ 
-syslibroot $PLATFORM/Developer/SDKs/iPhoneOS5.0.sdk/ 

:

$PLATFORM/Developer/usr/bin/arm-apple-darwin10-llvm-gcc-4.2 \ 
-c -o injection.o injection.c \ 
-isysroot $PLATFORM/Developer/SDKs/iPhoneOS5.0.sdk \ -fPIC 

arm-apple-darwin10-llvm-gcc-4.2: -fPIC: No such file or directory 

는 어떻게 해결할 수있는 오류가있다는 ... 무엇 그것은 의미는 무엇입니까?

[email protected]:~$ gcc \ -fPIC 
gcc: error: -fPIC: No such file or directory 
gcc: fatal error: no input files 
compilation terminated. 

이 옵션으로 인수를 고려 중지 (뿐만 아니라 아마도 LLVM-GCC) GCC를 만드는 라인의 중간에 \를 보인다 항상로 취급 :

답변

2

그것은 명령 줄을 잘못 입력 의미 파일 이름.

[email protected]:~$ gcc -fPIC 
gcc: fatal error: no input files 
compilation terminated. 

은 예상되는 결과를 제공합니다.

+0

매우 흥미 롭습니다. 그것은 실제로 그렇게합니다. 거의 백 슬래시가 그 자체의'''''''(마치 주석에 형식화 된 단일 백 슬래시 코드를 어떻게 입력합니까?) (http://meta.stackexchange.com/questions/129704/how-do -you-type-a-single-backslash-code-a-comment-comment-in-a-comment))은 전통적으로 옵션의 끝과 파일 인수의 시작을 표시하는''-'에 대한 대리였다. 일반적으로 파일과 옵션을 인터리빙합니다). –

+0

답변을 주셔서 감사합니다.하지만 코드를 컴파일하는 쿼리가 어떻게되어야하는지 이해할 수 없습니다. –

관련 문제