Bug 592255 - Linker shows an error when trying to link cv::imwrite
Summary: Linker shows an error when trying to link cv::imwrite
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: opencv
Version: 13
Hardware: x86_64
OS: Linux
low
medium
Target Milestone: ---
Assignee: Rakesh Pandit
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-05-14 11:24 UTC by Anonymous account
Modified: 2011-01-07 08:38 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-01-07 08:38:29 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
The cpp code to reproduce the error. (156 bytes, text/x-c++src)
2010-05-14 11:24 UTC, Anonymous account
no flags Details

Description Anonymous account 2010-05-14 11:24:50 UTC
Created attachment 414014 [details]
The cpp code to reproduce the error.

Description of problem:
If you try to link a C Plus Plus file, which uses the openCv function cv:: imwrite, it gets an undefined reference error.

undefined reference to `cv::imwrite(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::Mat const&, std::vector<int, std::allocator<int> > const&)'

The strange thing is, that it links all other tested opencv functions like cv::imread successfully.



Version-Release number of selected component (if applicable):
2.0.0-7.fc13

How reproducible:
Try to compile and link the code in the attachment.

Steps to Reproduce:
1. Download the attached code
2. Try to compile and link it:
g++ -I/usr/include/opencv  -lcxcore -lcv -lhighgui -lcvaux -lml opencv_bug.cpp
3.
  
Actual results:
[]$ g++ -I/usr/include/opencv  -lcxcore -lcv -lhighgui -lcvaux -lml opencv_bug.cpp 
/tmp/ccBD9wCz.o: In function `main':
opencv_bug.cpp:(.text+0xfa): undefined reference to `cv::imwrite(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::Mat const&, std::vector<int, std::allocator<int> > const&)'
collect2: ld returned 1 exit status

Expected results:
Compile and link sucessfully.

Additional info:

Comment 1 Nicolas Chauvet (kwizart) 2011-01-07 08:38:29 UTC
Sorry for the late answear:

Your code worked with :
g++ $(pkg-config --cflags opencv)  $(pkg-config --libs opencv) opencv_bug.cpp
Only tested on OpenCV 2.2 just updated in Rawhide. So At least Closing to Rawhide.


Note You need to log in before you can comment on or make changes to this bug.