hello, i m using open cv 2.4.13 and codeblocks-16.01mingw-setup, i cant compile the simple program, please help me , tanks [closed]

asked 2016-10-02 23:36:20 -0600

dodi369369 gravatar image

updated 2016-10-03 00:37:32 -0600

hello, i m using open cv 2.4.13 and codeblocks-16.01mingw-setup, i cant compile the simple program, please help me , tanks

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by StevenPuttemans
close date 2016-10-03 08:53:26.939369

Comments

1

for various reasons, please remove the useless screenshot, and give us a text version of

  • your code
  • how you link it
  • the errors you get !
berak gravatar imageberak ( 2016-10-02 23:48:07 -0600 )edit
1

using mingw is always a bit unfortunate. did you build the opencv libs for mingw before ? (you cannot use the prebuild VS libs)

berak gravatar imageberak ( 2016-10-02 23:50:12 -0600 )edit

i get error : undefined reference to `cv::imread(std::string const&, int)'

dodi369369 gravatar imagedodi369369 ( 2016-10-03 00:27:40 -0600 )edit
1

yes, let's find out why.

(and again, please remove the screenshot.)

well i did it. please, edit again, and give us any details you have.

berak gravatar imageberak ( 2016-10-03 00:30:23 -0600 )edit

did you build the opencv libs before or not ?

berak gravatar imageberak ( 2016-10-03 00:41:15 -0600 )edit

ok, i have a simple code, load an image (using imread), but i get error : undefined reference to `cv::imread(std::string const&, int)'

dodi369369 gravatar imagedodi369369 ( 2016-10-03 00:42:54 -0600 )edit
1

please answer my question

berak gravatar imageberak ( 2016-10-03 00:44:55 -0600 )edit

no, i did not build the opencv libs before

dodi369369 gravatar imagedodi369369 ( 2016-10-03 00:50:52 -0600 )edit

how to build the opencv libs?

dodi369369 gravatar imagedodi369369 ( 2016-10-03 00:56:41 -0600 )edit
1

so, you cannot use the prebuild libs, they're for another toolchain (VS).

if you're a n00b, your best option is to discard the whole codeblocks/mingw idea entirely, and get VS community edition instead (huge download, though)

if you insist tio use mingw, you'll have to:

  • get mingw64 (miingw32 won't work !)
  • get cmake
  • build the opencv libs using that.
berak gravatar imageberak ( 2016-10-03 00:59:32 -0600 )edit