2011-03-24 02:09:37     Porting OpenCV to Blackfin -- zlib error when compiling application

Document created by Aaronwu Employee on Aug 26, 2013
Version 1Show Document
  • View in full screen mode

2011-03-24 02:09:37     Porting OpenCV to Blackfin -- zlib error when compiling application

Anoop Ramakrishna (UNITED STATES)

Message: 99171   

 

Hi,

 

I'm trying to port OpenCV to Blackfin. I did configure and make and they ran without errors. However when I try to compile a basic helloworld type application, I get the following error :

 

../src/.libs/libhighgui.a(lib_highgui_la-loadsave.o): In function `cv::imencode(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::Mat const&, std::vector<unsigned char, std::allocator<unsigned char> >&, std::vector<int, std::allocator<int> > const&)':

highgui/loadsave.cpp:(.text+0xc18): warning: the use of `tmpnam' is dangerous, better use `mkstemp'

../src/.libs/libcxcore.a(lib_cxcore_la-cxpersistence.o): In function `icvClose(CvFileStorage*)':

cxcore/cxpersistence.cpp:(.text+0xbce): undefined reference to `_gzclose'

../src/.libs/libcxcore.a(lib_cxcore_la-cxpersistence.o): In function `icvEof(CvFileStorage*)':

cxcore/cxpersistence.cpp:(.text+0x40ce): undefined reference to `_gzeof'

../src/.libs/libcxcore.a(lib_cxcore_la-cxpersistence.o): In function `icvGets(CvFileStorage*, char*, int)':

cxcore/cxpersistence.cpp:(.text+0x42c6): undefined reference to `_gzgets'

../src/.libs/libcxcore.a(lib_cxcore_la-cxpersistence.o): In function `icvPuts(CvFileStorage*, char const*)':

cxcore/cxpersistence.cpp:(.text+0x47cc): undefined reference to `_gzputs'

../src/.libs/libcxcore.a(lib_cxcore_la-cxpersistence.o): In function `icvRewind(CvFileStorage*)':

cxcore/cxpersistence.cpp:(.text+0x1930e): undefined reference to `_gzrewind'

../src/.libs/libcxcore.a(lib_cxcore_la-cxpersistence.o): In function `_cvOpenFileStorage':

cxcore/cxpersistence.cpp:(.text+0x19a42): undefined reference to `_gzopen'

 

 

I did the configure process again and I saw this:

 

checking zlib.h usability... no

checking zlib.h presence... no

checking for zlib.h... no

 

 

The command I used to compile is this:

 

bfin-uclinux-g++ hello.c -o hello -I../include/opencv/ -L../src/.libs -lcv -lhighgui -lcvaux -lpthread

 

I've been googling about this, and some suggestions were about adding the -lz flag, however when I do that, it says that it cannot find the library, as so;

 

bfin-uclinux-g++ hello.c -o hello -I../include/opencv/ -L../src/.libs -lcv -lhighgui -lcvaux -lpthread -lz

 

 

/opt/uClinux/bfin-uclinux/lib/gcc/bfin-uclinux/4.1.2/../../../../bfin-uclinux/bin/ld.real: cannot find -lz

collect2: ld returned 1 exit status

 

 

 

I'm hoping someone can tell me what I should look at to work around this issue, I've been at it for quite some time, the configure file is pretty long and though I've identifed where zlib is supposed to be checked for, I can't discern the checking methodology. I would be most grateful if anyone could suggest anything.

 

Thanks

 

Anoop

QuoteReplyEditDelete

 

 

2011-03-24 02:19:26     Re: Porting OpenCV to Blackfin -- zlib error when compiling application

Mike Frysinger (UNITED STATES)

Message: 99172   

 

please read the documentation:

  docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:existing_libraries#using_libs_in_external_applications

QuoteReplyEditDelete

Attachments

    Outcomes