2012-07-29 4 views
0

OpenCv로 이미지 파일을 읽는 간단한 hello world 유형 프로그램을 컴파일하려고합니다. 그것은 잘 gcc (mpicc)와 함께 작동하지만, 내가 들어 가지 않을 이유에 대한 craycc를 사용하려고합니다. 이렇게하면 모든 라이브러리를 찾을 수 없다는 오류가 발생합니다. 그것은 이상한 길을 찾고있는 것 같습니다.craycc and OpenCV

누군가 여기서 일어나는 일에 대해 추측 할 수 있습니까? pkg-config opencv.pc 파일이 잘못된 경로를 제공 할 수 있습니까? typedef 오류가이 오류를 일으키는 지요 (누락 된 라이브러리가 남아있어 경고문이 사라지고 주석을 찾을 수 있습니까?)

나는 그것에 자고 무슨 일이 일어나는지 보려고합니다. 이 사람들을 읽을 시간을내어 주셔서 감사 드리며, 나는 무엇이라도 발견하면 다시보고해야합니다.

@hector-xe6-7:~/work/disparity> cc `pkg-config --cflags --libs opencv` hello.c -o hello 

CC-301 craycc: WARNING File = /home/d34/d34/s1138832/work/OpenCV-2.3/include/opencv2/core/types_c.h, Line = 159 
    The indicated "typedef" name has already been declared (with same type). 

    typedef unsigned short ushort; 
         ^

Total warnings detected in hello.c: 1 
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_core 
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_imgproc 
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_highgui 
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_ml 
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_video 
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_features2d 
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_calib3d 
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_objdetect 
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_contrib 
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_legacy 
/opt/cray/cce/8.0.4/cray-binutils/x86_64-unknown-linux-gnu/bin/ld: cannot find -lopencv_flann 
+1

경로 문제 인 것 같습니다. 테스트로서 pkg-config를 호출하는 대신 opencv 라이브러리의 경로를 하드 코딩 할 수 있습니까? 또한 라이브러리가 제대로 설치되었고 모든 라이브러리 심볼릭 링크가 있는지 확인하십시오. http://stackoverflow.com/questions/335928/ld-cannot-find-an-existing-library –

+0

Cray의 컴파일러는 언어 표준에 대해 너무 엄격합니다. 이는 소스의 버그 일 가능성이 높습니다. 패치를 수정하고 업스트림을 제출해야합니다. – Jeff

답변

1

컴파일시 -dynamic 플래그를 추가하여이를 해결했습니다.