Reputation: 5133
I'm running 32-bit Windows 7 Enterprise and CodeBlocks 10.05.
I followed this tutorial to set up OpenCV 2.2 to work with CodeBlocks.
Any programs that use the C CodeBlocks API work fine - they compile, link, and run fine.
However, when I try to use C++ OpenCV functions and objects, .o
files are generated, but I get linking errors, such as:
undefined reference to
`cv::cvtColor(cv::Mat const&, cv::Mat&, int, int)'
After some Googling, I found that this was because I didn't include enough libraries in my search directories. However, I don't know what libraries to include.
After some searching in my OpenCV folder, I found some .a
files in 3rdParty/lib
and added them, too. But my problem persists.
Does anyone know what libraries I have to include in order to get my program to work?
If you need more information, please tell me and I'll give it to you.
Upvotes: 3
Views: 16950
Reputation: 705
I had the same problem and tried the above which did not work and I have downloaded the precompiled OpenCV.
So what worked for me was to include the following header.
Hope this helps.
Upvotes: 5
Reputation: 7985
If you are using eclipse
Of course , I assume you have already compiled the source folder with CMake. If you haven't done already refer to this video
https://www.youtube.com/watch?v=kVyVEHK4qfQ
In the first 8 min, you will learn every configuration.
Upvotes: 0