KEMBAR78
Using openCV 2.0 with Dev C++ | PDF
Using	openCV 2.0	
with	Dev	C++
David	Hsu
Installations
• Install	OpenCV2.0		(OpenCV-2.0.0a-win32.exe)	under	C:
• Install	Dev	C++	(devcpp-4.9.9.2_setup.exe)	under	C:
In	Dev	C++
• Tool	à Compiler	Options
Compiler	Options
• Add	Compiler	set	to	configure:	OpenCV2.0
Compiler	Options
• Add	Compiler	set	to	configure:	OpenCV2.0
Add	commands
• Add	these	commands	to	the	linker	command	line
-llibcxcore200	-llibcv200	-llibcvaux200	-llibhighgui200	-llibml200
Directories	à Binaries
• Compiler	Options	à Directories	à Binaries
Add	:	C:OpenCV2.0bin
Directories	à Binaries
• Compiler	Options	à Directories	à Binaries
Add	:	C:Dev-Cpplibexecgccmingw323.4.2
Directories	à Binaries
• Compiler	Options	à Directories	à Binaries
Directories	à Libraries
• Compiler	Options	à Directories	à Libraries
Add	:	C:OpenCV2.0lib
Directories	à Libraries
• Compiler	Options	à Directories	à Libraries
Directories	à C	Includes
• Compiler	Options	à Directories	à C	Includes
Add	:	C:OpenCV2.0includeopencv
Directories	à C	Includes
• Compiler	Options	à Directories	à C	Includes
Directories	à C++	Includes
• Compiler	Options	à Directories	à C++	Includes
Add	:	C:OpenCV2.0includeopencv
Directories	à C++	Includes
• Compiler	Options	à Directories	à C++	Includes
C:OpenCV2.0includeopencv
cxoperations.h
Modify	the	code	in	line	68
• #if	__GNUC__	>=	4	||	__MINGW32__
Ready	to	GO
• Put	an	image	under	the	same	folder	with	“cvTest.cpp”.
• Try	to	compile	and	run	(F9)	“cvTest.cpp”	with	Dev	C++
• You	may	need	to	update	the	image’s	name	in	“cvTest.cpp”,	
including	the	filename	extension	(i.e.	image	type	like	.bmp	/	
.jpg	/	.png …)
cvTest.cpp
• Put	the	image	under	the	same	folder	with	“cvTest.cpp”
• Update	the	image’s	name	to	filename[]
cvTest.cpp
• Compile	and	Run	(F9)
cvShowImage
•

Using openCV 2.0 with Dev C++