Ask Your Question
1

how do i configure opencv with code blocks in ubuntu

asked 2015-07-12 03:33:21 -0600

roshantac gravatar image

i am using ubuntu 15.04, installed opencv 3.00 ,i have latest version of code blocks with me,

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-08-07 02:56:34 -0600

mshabunin gravatar image

updated 2015-08-07 02:57:00 -0600

Try to run cmake with CodeBlocks generator: cmake ../opencv -G"CodeBlocks - Unix Makefiles"

(Some variants here: http://www.cmake.org/cmake/help/v3.0/...)

This command should generate OpenCV CodeBlocks project in current directory.

edit flag offensive delete link more

Comments

Not quite sure what is going on here. 1) Use CodeBlocks to create a new OpenCV project (which simply loads up a lena.jpg for viewing) That creates a directory. 2) go to that current directory and run cmake per your instructions. 3) Now that directory has two different .cbp files contained within. 4) Build and run = error, can't find opencv2/core/core.hpp This answer is clear as mud. Can you help? How do you configure opencv with codeblocks in ubuntu?

zipzit gravatar imagezipzit ( 2015-12-27 03:38:43 -0600 )edit
0

answered 2015-08-07 06:15:37 -0600

if you succeed in doing

  • cmake configuration
  • make and make install command

and you have a configured system, then open up Code::Blocks, create a new project, select a console project. Then right click on the project name, build options, linker settings. Inside the 'other linker options' you now add the command pkg-config opencv --libs and you make sure that it is in angled brackets (cannot display them here). Finally in your source file you add #include <opencv2/opencv.hpp> and using namespace cv; and you are good to go.

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2015-07-12 03:33:21 -0600

Seen: 2,249 times

Last updated: Aug 07 '15