Solving some "Symbol not found" problems for libJPEG, libTIFF, libGL, libPng

Ryan Schmidt ryandesign at macports.org
Thu Nov 18 15:30:18 PST 2010


Let's keep the discussion on the mailing list.


On Nov 18, 2010, at 17:07, Robert Baruch wrote:

> I installed opencv via Macports, then tried this test program:
> 
> #include “highgui.h”
> 
> int main( int argc, char** argv ) {
>   IplImage* img = cvLoadImage( argv[1] );
>   cvNamedWindow( “Example1”, CV_WINDOW_AUTOSIZE );
>   cvShowImage( “Example1”, img );
>   cvWaitKey(0);
>   cvReleaseImage( &img );
>   cvDestroyWindow( “Example1” );
> }

With opencv @2.1.0_0 installed, I tried compiling your sample program by pasting it into a new test.c text file and running:

gcc test.c -I/opt/local/include/opencv -L/opt/local/lib -lcxcore -lhighgui

and it said:

test.c: In function ‘main’:
test.c:5: error: too few arguments to function ‘cvLoadImage’

I changed cvLoadImage( argv[1] ) to cvLoadImage( argv[1], 1 ) and it compiled fine.

It produced this output when I ran it:

$ ./a.out 
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct NULL not valid
Abort trap

In other words, I see other problems, not the problem you're reporting.


> Linked against libcxcore.dylib, libcvaux.dylib, libcv.dylib, libhighgui.dylib, and libml.dylib.
> 
> Searching google shows that opencv is not the only package that runs into similar problems (if indeed it's the package's fault).


> On Nov 18, 2010, at 3:19 PM, Ryan Schmidt wrote:
> 
>> The Apple and MacPorts versions of these libraries coexist just fine most cases. I cannot advocate the steps you described below, and without further information, I cannot say why you experienced problems before.



More information about the macports-users mailing list