OpenCV2.0 und dev C++
-
hallo leute, ich versuche gerade mich in opencv2.0 und dev c++ einzuarbeiten und schon beim ersten programm klappts nicht so richtig.
ich weiß nicht wo das problem genau liegt, aber ich nehme an das problem hat was mit der konfiguration von opencv2.0 und dev c++ zu tun: erstens gibt es keine so richtige dokumentation davon und zweitens stehts auch nirgendwo.
ich hoffe einer von euch kann mir dabei helfen:
also ich das programm(das bild bmw.bmp ist im selbem verzeichnis):#include "highgui.h"
int main( int argc, char** argv )
{
IplImage* img = cvLoadImage( argv[1] );
img=cvLoadImage("bmw.BMP");
cvNamedWindow( "bmw.BMP", CV_WINDOW_AUTOSIZE );
cvShowImage( "bmw.BMP", img );
cvWaitKey(0);
cvReleaseImage( &img );
cvDestroyWindow( "bmw.BMP" );
}kompiliere, bekomme ich diese fehlermeldung und habe keine ahnung wo das problem liegt:Compiler: OpenCV
Executing g++.exe...
g++.exe "C:\OpenCV\opentest1.cpp" -o "C:\OpenCV\opentest1.exe" -L"C:\OpenCV\lib" -lcxcore200. -lcv200. -lcvaux200. -lhighgui200. -lml200. -lcxts200. -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -I"C:\OpenCV\include\opencv" -I"C:\OpenCV\src\cv" -I"C:\OpenCV\src\cvaux" -I"C:\OpenCV\src\cxcore" -I"C:\OpenCV\src\highgui" -I"C:\OpenCV\ml" -L"C:\Dev-Cpp\lib" -L"C:\OpenCV\lib"
In file included from C:/OpenCV/include/opencv/cxcore.hpp:2243,
from C:/OpenCV/include/opencv/cxcore.h:2123, from C:/OpenCV/include/opencv/highgui.h:47,
from C:\OpenCV\opentest1.cpp:3:C:/OpenCV/include/opencv/cxoperations.hpp: In member functionvoid cv::Ptr<_Tp>::addref()': C:/OpenCV/include/opencv/cxoperations.hpp:1442: error: there are no arguments to__exchange_and_add' that depend on a template parameter, so a declaration of\_\_exchange\_and\_add' must be available C:/OpenCV/include/opencv/cxoperations.hpp:1442: error: (if you use-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
C:/OpenCV/include/opencv/cxoperations.hpp: In member functionvoid cv::Ptr<_Tp>::release()': C:/OpenCV/include/opencv/cxoperations.hpp:1446: error: there are no arguments to__exchange_and_add' that depend on a template parameter, so a declaration of\_\_exchange\_and\_add' must be available C:/OpenCV/include/opencv/cxoperations.hpp: In member functioncv::Ptr<_Tp>& cv::Ptr<_Tp>::operator=(const cv::Ptr<_Tp>&)':
C:/OpenCV/include/opencv/cxoperations.hpp:1473: error: there are no arguments to\_\_exchange\_and\_add' that depend on a template parameter, so a declaration of__exchange_and_add' must be availableIn file included from C:/OpenCV/include/opencv/cxcore.hpp:2244,
from C:/OpenCV/include/opencv/cxcore.h:2123, from C:/OpenCV/include/opencv/highgui.h:47,
from C:\OpenCV\opentest1.cpp:3:C:/OpenCV/include/opencv/cxmat.hpp: In copy constructorcv::Mat::Mat(const cv::Mat&)': C:/OpenCV/include/opencv/cxmat.hpp:102: error:__exchange_and_add' undeclared (first use this function)
C:/OpenCV/include/opencv/cxmat.hpp:102: error: (Each undeclared identifier is reported only once for each function it appears in.)
C:/OpenCV/include/opencv/cxmat.hpp: In constructorcv::Mat::Mat(const cv::Mat&, const cv::Range&, const cv::Range&)': C:/OpenCV/include/opencv/cxmat.hpp:174: error:__exchange_and_add' undeclared (first use this function)C:/OpenCV/include/opencv/cxmat.hpp: In constructorcv::Mat::Mat(const cv::Mat&, const cv::Rect&)': C:/OpenCV/include/opencv/cxmat.hpp:189: error:__exchange_and_add' undeclared (first use this function)C:/OpenCV/include/opencv/cxmat.hpp: In member functioncv::Mat& cv::Mat::operator=(const cv::Mat&)': C:/OpenCV/include/opencv/cxmat.hpp:239: error:__exchange_and_add' undeclared (first use this function)C:/OpenCV/include/opencv/cxmat.hpp: In member functionvoid cv::Mat::addref()': C:/OpenCV/include/opencv/cxmat.hpp:342: error:__exchange_and_add' undeclared (first use this function)
C:/OpenCV/include/opencv/cxmat.hpp: In member functionvoid cv::Mat::release()': C:/OpenCV/include/opencv/cxmat.hpp:346: error:__exchange_and_add' undeclared (first use this function)C:/OpenCV/include/opencv/cxmat.hpp: In copy constructorcv::MatND::MatND(const cv::MatND&)': C:/OpenCV/include/opencv/cxmat.hpp:3648: error:__exchange_and_add' undeclared (first use this function)C:/OpenCV/include/opencv/cxmat.hpp: In member functioncv::MatND& cv::MatND::operator=(const cv::MatND&)': C:/OpenCV/include/opencv/cxmat.hpp:3677: error:__exchange_and_add' undeclared (first use this function)
C:/OpenCV/include/opencv/cxmat.hpp: In member functionvoid cv::MatND::addref()': C:/OpenCV/include/opencv/cxmat.hpp:3717: error:__exchange_and_add' undeclared (first use this function)
C:/OpenCV/include/opencv/cxmat.hpp: In member functionvoid cv::MatND::release()': C:/OpenCV/include/opencv/cxmat.hpp:3722: error:__exchange_and_add' undeclared (first use this function)C:/OpenCV/include/opencv/cxmat.hpp: In member functioncv::SparseMat& cv::SparseMat::operator=(const cv::SparseMat&)': C:/OpenCV/include/opencv/cxmat.hpp:4081: error:__exchange_and_add' undeclared (first use this function)C:/OpenCV/include/opencv/cxmat.hpp: In member functionvoid cv::SparseMat::addref()': C:/OpenCV/include/opencv/cxmat.hpp:4112: error:__exchange_and_add' undeclared (first use this function)
C:/OpenCV/include/opencv/cxmat.hpp: In member functionvoid cv::SparseMat::release()': C:/OpenCV/include/opencv/cxmat.hpp:4116: error:__exchange_and_add' undeclared (first use this function)Execution terminatedWO IST DER FEHLER ????
dann würde ich gerne wissen, ob ich nicht besser mit visual c++ anstatt dev c++ arbeiten solte?
vielen dank für eure antwortenchill out
-
Schau dir mal in der FAQ zum Compiler- und IDE Forum den Thread zum Dev-C++ durch - der ist ziemlich veraltet. In diesem Fall ist entweder der opencv-code nicht standardkonform oder der gcc, der im dev+c++ mitgekommen ist ist zu alt um ihn richtig zu verstehen.
-
Hallo
Schau mal auf:
http://opencv.willowgarage.com/wiki/InstallGuideBuilding on Windows using MinGW 3.4.5
If you get compile errors to do with __exchange_and_add it is due to the wrong definition of CV_XADD. It can be fixed by:
1. Open cxoperations.hpp (found in <Open CV base dir>\include\opencv)
2. Find this section (lines 67-68 in 2.0):#else
#include <bits/atomicity.h>
#if __GNUC__ >= 43. And update it to reference a new definition, __MINGW32__ (defined by the MinGW compiler, see http://predef.sourceforge.net/precomp.html#sec31):
#else
#include <bits/atomicity.h>
#if __GNUC__ >= 4 || __MINGW32__Hoffe das löst dein Problem
Grüße
Michael
-
Nimm Visual C++ 2008 Express SP1 :xmas1:
-
DarkShadow44 schrieb:
Nimm Visual C++ 2008 Express SP1 :xmas1:
Die Beta 2 der kommenden 2010er Edition ist auch ziemlich stabil.
Das bessere IntelliSense macht wirklich einiges aus (den Rest hab ich nicht bemerkt^^)
-
bevor hier jetzt in 2 monate alten Threads irgendwas geschrieben wird was den OP vermutlich eh nicht mehr interessiert mach ich mal zu...