Undefined reference to imread () in embarcadero dev c++ in windows 7 32 bit

I’m using windows 7 32 bit. To compile c++, I use embarcadero dev c++. Whike using opencv, I found this error in my code :

C:\Program Files\Embarcadero\Dev-Cpp\TDM-GCC-64\x86_64-w64-mingw32\bin\ld.exe C:\Users\JEYAMA~1.001\AppData\Local\Temp\ccqNArVM.o:main.cpp:(.text+0x4c): undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, int)’

My code is:

#include “C:\opencv\build\include\opencv2\opencv.hpp”
using namespace std;
using namespace cv;
int main()
{
Mat image=Mat();
image=imread(“Capture1.JPG”);
getchar();
return 0;
}
Mat::~Mat(){};

I searched about this error in web. Even in SO, i found answers only for Linux operating systems. They said to use g++ compiler in terminal with some input. But what shall I do in windows???

Please anyone guide me.

For proper understanding, I have included pics of my program and image here.

My compiler settings:

Libraries

General settings:

C settings

Bin settings

I saw your issues on stack overflow.

these are linker errors. other people told you that already.

this isn’t a problem of OpenCV, but of handling that specific IDE.

Please suggest an IDE for me pls

if you use OpenCV’s release for Windows, you will need Visual Studio (Community edition). that is because OpenCV’s windows release is built using Microsoft’s compiler.

your IDE uses mingw (GCC for windows), which has a different format for libraries. you would need a build of OpenCV that was made with mingw.

if you want to get to know OpenCV, I would suggest that you stop using C++ and just go with python. it’s a lot easier to work with.

if you want to learn C++ and how to deal with compilers… stay on the path you are on.

1 Like

Which version of Microsoft visual studio will be supported by my windows 7 32 bit?

i don’t think, there are prebuilt 32bit opencv libs anymore
(most likely you will have to build from (github) src)

When I used Ubuntu 16, I got too many errors. In SO, they said that ubuntu 16 won’t support opencv. What shall I do to use opencv in ubuntu 16??? Please guide me

you seem to have a problem with outdated stuff …

Any solution for that please???

yes again: build from src

why do all those screenshots say “64 bit” when referring to the toolchain (GCC)?

that shouldn’t be able to run on a 32 bit windows (or it’s a cross-compiler toolchain, which I doubt very much).

what evidence do you have that your windows isn’t 64 bit, but 32 bit?

what prevents you from using a recent release of ubuntu instead of that 5-year-old stuff? I’d suggest upgrading windows too… but I don’t know if that would cost you.

Of course, prebuilt OpenCV can be used, for example from here:

…Especially as self-building for MingW seems to be quite a hassle…

1 Like

last prebuilt x86 version there is unfortunately 4.1.0