【发布时间】:2011-12-03 00:47:33
【问题描述】:
我正在使用 XCode 4 进行开发,并链接了 OpenCV 库以创建一些实验项目。
如果在编译此行时发现问题:
int main (int argc, const char * argv[])
{
IplImage* img = cvLoadImage( argv[1]);
cvNamedWindow( "Example3-in" );
cvNamedWindow( "Example3-out" );
// Show the original image
cvShowImage("Example3-in", img);
// Create an image for the output
IplImage* out = cvCreateImage( cvGetSize(img), IPL_DEPTH_8U, 3 );
// Perform a Gaussian blur
cvSmooth( img, out, CV_GAUSSIAN, 11, 11 );
// Show the processed image
cvShowImage("Example3-out", out);
cvWaitKey(0);
cvReleaseImage( &img );
cvReleaseImage( &out );
cvDestroyWindow( "Example3-in" );
cvDestroyWindow( "Example3-out" );
return 0;
}
问题:
Undefined symbols for architecture x86_64:
"_cvSmooth", referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
在我看来,就像这些库不是针对 64 位架构编译的...
注意:
通过 MacPorts 安装的库
【问题讨论】:
标签: c++ compiler-construction xcode4 opencv linker