linux 下 opencv程序怎么编译
展开全部
运行了楼上给的命令之后,结果是这样的:
# g++ `pkg-config opencv --libs --cflags opencv` facedect.cpp -o facedect -static
/tmp/cc8XhRf6.o: In function `find_face(_IplImage*)':
facedect.cpp:(.text+0x51): undefined reference to `cvCreateImage'
facedect.cpp:(.text+0xc0): undefined reference to `cvCreateImage'
facedect.cpp:(.text+0xdd): undefined reference to `cvCvtColor'
facedect.cpp:(.text+0xf7): undefined reference to `cvResize'
facedect.cpp:(.text+0x109): undefined reference to `cvEqualizeHist'
facedect.cpp:(.text+0x116): undefined reference to `cvClearMemStorage'
facedect.cpp:(.text+0x188): undefined reference to `cvHaarDetectObjects'
facedect.cpp:(.text+0x1c6): undefined reference to `cvReleaseImage'
facedect.cpp:(.text+0x1d1): undefined reference to `cvReleaseImage'
/tmp/cc8XhRf6.o: In function `isperson(char const*)':
facedect.cpp:(.text+0x21e): undefined reference to `cvLoad'
facedect.cpp:(.text+0x22f): undefined reference to `cvCreateMemStorage'
facedect.cpp:(.text+0x25a): undefined reference to `cvLoadImage'
facedect.cpp:(.text+0x27d): undefined reference to `cvReleaseImage'
facedect.cpp:(.text+0x289): undefined reference to `cvDestroyWindow'
collect2: ld returned 1 exit status
# g++ `pkg-config opencv --libs --cflags opencv` facedect.cpp -o facedect -static
/tmp/cc8XhRf6.o: In function `find_face(_IplImage*)':
facedect.cpp:(.text+0x51): undefined reference to `cvCreateImage'
facedect.cpp:(.text+0xc0): undefined reference to `cvCreateImage'
facedect.cpp:(.text+0xdd): undefined reference to `cvCvtColor'
facedect.cpp:(.text+0xf7): undefined reference to `cvResize'
facedect.cpp:(.text+0x109): undefined reference to `cvEqualizeHist'
facedect.cpp:(.text+0x116): undefined reference to `cvClearMemStorage'
facedect.cpp:(.text+0x188): undefined reference to `cvHaarDetectObjects'
facedect.cpp:(.text+0x1c6): undefined reference to `cvReleaseImage'
facedect.cpp:(.text+0x1d1): undefined reference to `cvReleaseImage'
/tmp/cc8XhRf6.o: In function `isperson(char const*)':
facedect.cpp:(.text+0x21e): undefined reference to `cvLoad'
facedect.cpp:(.text+0x22f): undefined reference to `cvCreateMemStorage'
facedect.cpp:(.text+0x25a): undefined reference to `cvLoadImage'
facedect.cpp:(.text+0x27d): undefined reference to `cvReleaseImage'
facedect.cpp:(.text+0x289): undefined reference to `cvDestroyWindow'
collect2: ld returned 1 exit status
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询