Can you please help me with the following issue?
I am running Code::Blocks 13.12 on 64-bit Debian Linux. I am new user of this IDE. When I create new OpenCV project in Code::Blocks and set proper compiler flags and linker flags, i.e. by putting ...
- `pkg-config opencv --cflags` into Settings > Compiler > Compiler settings tab > Other options tab
- `pkg-config opencv --libs` into Settings > Compiler > Linker settings tab > Other linker options
- /usr/include/, /usr/include/opencv/, /usr/include/opencv2/ paths into Settings > Compiler > Search directories tab > Compiler tab,
compilation of the project is just fine. The only thing that doesn't work is code completion for OpenCV functions.
I have following code in main.cpp. When I click right mouse button over the imread function and choose Find declaration of: 'imread' menu option, an alert with Not found: imread message is raised. But doing same thing on STD's cerr works as expected.
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
using namespace std;
using namespace cv;
int main( int argc, char * argv[] ) {
Mat img = imread( "lena.jpg", CV_LOAD_IMAGE_COLOR );
if ( img.empty() ) {
cerr << "Unable to load the Lena image!" << endl;
return -1;
}
namedWindow( "lena", CV_WINDOW_AUTOSIZE );
imshow( "lena", img );
waitKey( 0 );
return 0;
}
When I choose the Symbols tab on the left vertical bar, I can see the cv namespace there but it seems empty. There are no subitems and it can not be expanded as the std namespace.
Am I doing something wrong? How should I persuade the Code::Blocks to parse also OpenCV's headers? Just restarting/reopenning IDE/project doesn't work. :-)
Thank you very much for your replies.