j'ai un problème pour faire fonctionner opencv avec Qtcreator. J'ai opencv d'installé sur mon mac (10.10) et qui marche très bien avec Xcode. Cependant, quand je compile avec Qtcreator j'ai une erreur. J'ai vue pas mal de réponses sur les forums mais ça n'a jamais marché pour moi. Je demande donc votre aide car j'en ai besoin pour mon stage.
Mat image; image = imread(argv[1], CV_LOAD_IMAGE_COLOR); // Read the file
if(! image.data ) // Check for invalid input { cout << "Could not open or find the image" << std::endl ; return -1; }
namedWindow( "Display window", WINDOW_AUTOSIZE );// Create a window for display. imshow( "Display window", image ); // Show our image inside it.
waitKey(0); // Wait for a keystroke in the window return 0; }
Et voici mon .pro avec plein de truc rajouté que j'ai trouvé sur différent forum
#------------------------------------------------- # # Project created by QtCreator 2015-06-05T10:31:59 # #-------------------------------------------------
Undefined symbols for architecture x86_64: "cv::namedWindow(cv::String const&, int)", referenced from: _main in main.o "cv::Mat::deallocate()", referenced from: cv::Mat::release() in main.o "cv::Mat::copySize(cv::Mat const&)", referenced from: cv::Mat::operator=(cv::Mat const&) in main.o "cv::String::deallocate()", referenced from: cv::String::~String() in main.o "cv::String::allocate(unsigned long)", referenced from: cv::String::String(char const*) in main.o "cv::imread(cv::String const&, int)", referenced from: _main in main.o "cv::imshow(cv::String const&, cv::_InputArray const&)", referenced from: _main in main.o "cv::waitKey(int)", referenced from: _main in main.o "cv::fastFree(void*)", referenced from: cv::Mat::~Mat() in main.o ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [test_opencv_qt.app/Contents/MacOS/test_opencv_qt] Error 1 14:12:32: Le processus "/usr/bin/make" s'est terminé avec le code 2. Erreur lors de la compilation/déploiement du projet test_opencv_qt (kit : Desktop Qt 5.4.2 clang 64bit) When executing step "Make"