1

When I try to use OpenCv 2.3 in Borland, I add these folders to the project:

C:\Program Files\opencv2.3.1\build\include\opencv2
C:\Program Files\opencv2.3.1\include\opencv

and include

opencv_core231.lib
opencv_highgui231.lib
opencv_video231.lib
opencv_imgproc231.lib

Then become bunch of errors

[BCC32 Error] complex(194): E2316 '_fm_atan2l' is not a member of 'std'
[BCC32 Error] complex(199): E2316 '_fm_cosl' is not a member of 'std'

and etc. in file complex.

How can I fix this?

Mat
  • 202,337
  • 40
  • 393
  • 406
fen1ksss
  • 1,100
  • 5
  • 21
  • 44

1 Answers1

1

I think the issue you are having is that Borland cannot natively link to Visual C++ libraries, which if you downloaded the OpenCV 2.3 binary build, that is what you have. You could try to use Borland's implib. See this StackOverflow answer. However, I think this has the caveat that the code must only be C code due to the fact that Visual C++ mangles names when classes are used in DLLs. Since OpenCV does use classes, I have my doubts that implib will work.

So, I would recommend using CMake to build OpenCV with the Borland C++ target. Here is a GUI capture of what this should look like from CMake.

CMake Borland target

Take a look at this build guide.

Community
  • 1
  • 1
mevatron
  • 13,911
  • 4
  • 55
  • 72
  • When i'm trying to write in command line "make" (after CMAKE) it becomes the same errors in file complex.. – fen1ksss Nov 01 '11 at 19:06
  • previously i have tried to use OpenCv b5a and everything was compiled good. – fen1ksss Nov 01 '11 at 19:08
  • What steps are you taking to build OpenCV 2.3.1? – mevatron Nov 01 '11 at 22:57
  • i have download Cmake 2.8.6, installed and run, chose the main directory Opencv2.3.1 with make-files and chose another directory to build. then have open command line in Windows, chose that directory and typed make (cause mingw32-make didn't work) and it was the same errors in command line – fen1ksss Nov 02 '11 at 12:22
  • Unfortunately, I do not own a copy of C++ Builder, so I cannot help you further figure out what the issue is. Have you tried to build OpenCV in MinGW or Visual Studio C++ Express with success? – mevatron Nov 04 '11 at 21:54
  • With VS everything work great. But it's interesting whats wrong with Borland C++ – fen1ksss Nov 05 '11 at 18:32