2014-09-11 5 views
1

Gustavo가 제기 한 질문과 정확히 같은 상황에 직면했습니다. 다음은 Link입니다. 또한, 그 링크와 다른 태그 (예 : libusus.a에서 라이브러리 이름을 opus.a로 변경하고 '\'를 '/'등으로 변경)와 같은 모든 태그를 시도했지만 이들 중 아무 것도 내 문제를 해결하지 못했습니다. . 라이브러리 파일의 속성을 열면, 이들은 다음 사항이 표시됩니다Mingw와 Eclipse가 라이브러리를 찾을 수 없습니다. - 2

경로 : 유형

/demo/opusfile/libopusfile.a : 파일 (정적 라이브러리)

위치 : U : \ 데이터 \ 취기 \ 일식 \ wrksp \ 데모 \ opusfile \ libopusfile.a 다음과 같이와 Mingw에 의해 표시

오류 메시지는 다음과 같습니다

15:56:57 **** Incremental Build of configuration Debug for project demo **** 
Info: Internal Builder is used for build 
gcc -o demo.exe "src\\demo.o" -lU:/data/Jag/eclipse/wrksp/demo/opusfile/libopusfile.a 
c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot find -lU:/data/Jag/eclipse/wrksp/demo/opusfile/libopusfile.a 
collect2.exe: error: ld returned 1 exit status 

collect2.exe: error: ld returned 1 exit status 

내가 누락 된 부분을 알려주시겠습니까? 이 문제를 해결할 수 없습니다.

답변

1

해결책을 찾은 것 같습니다. 대답은 Link에 게시되었습니다. 그래서 기본적으로 해결책을 요약하기 위해 라이브러리를 지정할 때 'lib'접두사, '.a'접미어 및 라이브러리 경로를 제거해야했습니다 (-l 매개 변수). 라이브러리 경로는 -L 매개 변수에 지정되어야합니다. 이것은 위의 문제를 해결하지만,와 Mingw에 의해 또 다른 장애물을 주도 : 컴파일러에 의해 제안

libopusfile.dll.a: could not read symbols: Archive has no index; run ranlib to add one. 

내가,

cmd_path> ranlib libopusfile.dll.a 
프롬프트 명령에서 '대한 ranlib'명령을 실행하고,이 해결 내 모든 문제!