运行了楼上给的命令之后,结果是这样的:
# 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'