After it finished building and generating I used the command make install to create the makefiles but I get an error when it tries to link saying:
[ 97%] Linking CXX executable ..\..\bin\opencv_annotationd.exe
Embarcadero C++ 7.40 for Win32 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.
Embarcadero Technologies Inc. bcc32x version 5.0.2 (36752.0cce431.9f79754) (based on LLVM 5.0.2)
Target: i686-pc-windows-omf
Thread model: posix
InstalledDir: C:\Program Files (x86)\Embarcadero\Studio\20.0\bin
bcc32x.exe: warning: argument unused during compilation: '-nobuiltininc' [-Wunused-command-line-argument]
"\"C:\\Program Files (x86)\\Embarcadero\\Studio\\20.0\\bin\\ilink32.exe\"" "@\"C:\\Users\\xanderv\\AppData\\Local\\Temp\\opencv_annotationd-63732a.cfg\""
Turbo Incremental Link 6.90 Copyright (c) 1997-2017 Embarcadero Technologies, Inc.
Fatal: Unable to open file '....LIBOPENCV_CORE453D.LIB'
bcc32x.exe: error: linker command failed with exit code 2 (use -Xdriver -v to see invocation)
** error 2 ** deleting bin\opencv_annotationd.exe
** error 1 ** deleting apps\annotation\CMakeFiles\opencv_annotation.dir\all
** error 1 ** deleting all
I always get that error when trying to use the make install command and when trying to search if it is on my computer, it canât be found anywhere. I donât get the error when I use the ninja command like it is explained here. But when using ninja I donât get it working like I explained in this problem.
This error occurs every time it wants to link exe files. How can I fix this error?
Thanks for the reply, after adding -DBUILD_opencv_apps=OFF it built correctly in the build folder. From the build folder I added the lib folder to tools->options->Language->C++ Options->Paths and Directories->Library Path. In âŚ->Paths and Directories->System Include Path I added the install folder of the build folder and the include of that install folder. After that I added all the lib files from the staticlib folder of the install folder to the project folder of the project I want to test. But when I want to test if I can use OpenCV by using a simple line of code Mat frame; I get the following error:
[ilink32 Error] Error: Unresolved external 'cv::Mat::Mat()' referenced from C:\USERS\XANDERV\DOCUMENTS\GIT\APPLICATION SOFTWARE\OPENCVTEST\WIN32\DEBUG\MAIN.OBJ
[ilink32 Error] Error: Unresolved external 'cv::Mat::{1173}...' referenced from C:\USERS\XANDERV\DOCUMENTS\GIT\APPLICATION SOFTWARE\OPENCVTEST\WIN32\DEBUG\MAIN.OBJ
[ilink32 Error] Error: Unable to perform link
Sadly the project I need to add OpenCv to is created in WIN32 and want to see if it can be possible to be added for WIN32. Is the error because I use WIN32 or did I not correctly add the lib files to the project?
congratulations !
you got way further than the other dozen or so ppl trying before !
opencv_core missing somehow somewhere.
there is probably a (generated) linker cmdline, can you show it ?
if youâre linking static libs, order matters , so everything depending on core should go before that with linking (else you get unexplainable errors like above !)
I have tried to reorder the libraries but I have not yet found a way to do that. It keeps ordering it alphabetically so I thought to create the opencv_world.lib file and try if that would work. To do that I added to the CMake command:
-DBUILD_opencv_world=ON
After generating and buidling the files and running make install I get the following error when it tries to link the opencv_world library:
Error: the combinations '+*' or '*+' are not allowed
Along with a lot of warnings that looks like this:
Warning: duplicate file 'rc' in list, not added!
Warning: unknown command line switch 'o' ignored
Do I need to add something to the CMake command or is it not possible for borland makefiles?
I found out that I get this error because the lib file for opencv_core is completely empty. Did I do something wrong with the CMake command or is there another problem?
.o implies that either (1) the compiler was told to compile something of that name or (2) something expects that file to be compiled, which obviously makes no sense.
When trying to run opencv for embarcadero C++ builder 10.3 I changed a few things in the folder of OpenCV:
error: use of undeclared identifier âuintptr_tâ = add #include in âŚ\opencv-4.7.0\3rdparty\ittnotify\include\ittnotify.h
error: use of undeclared identifier âlrintfâ = add #include <math.h> in âŚ/opencv-4.7.0/modules/core/include\opencv2/core/fast_math.hpp
error: unknown type name âFILEâ = add #include <stdio.h> in âŚ/opencv-4.7.0/modules/core/include\opencv2/core/operations.hpp
error: use of undeclared identifier âllvmâ = comment it out and make it return 0; instead in âŚ/opencv-4.7.0/modules/core/include\opencv2/core/hal/intrin.hpp
error: token is not a valid binary operator in a preprocessor subexpression in #if (i64_fromNaN != i64_fromPosOverflow) || (i64_fromNaN != i64_fromNegOverflow) = comment out: #if (i64_fromNaN != i64_fromPosOverflow) || (i64_fromNaN != i64_fromNegOverflow)
if ((exp == 0x7FF) && sig) { #if (i64_fromNaN == i64_fromPosOverflow)
sign = 0; #elif (i64_fromNaN == i64_fromNegOverflow)
sign = 1; #else
raiseFlags(flag_invalid);
return i64_fromNaN; #endif
} #endif in âŚ\opencv-4.7.0\modules\core\src\softfloat.cpp
My guess the reason why the core lib is empty is because of one of the changes I made to the files. I could solve three errors by adding an header to the code, but I donât know how to solve the last two errors. The error messages from RAD studio prompt about the last two errors is shown below: llvm:
[ 5%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/algorithm.cpp.obj
Embarcadero C++ 7.40 for Win32 Copyright (c) 2012-2018 Embarcadero Technologies, Inc.
C:\OpenCV\opencv-4.7.0\modules\core\src\algorithm.cpp:
In file included from C:\OpenCV\opencv-4.7.0\modules\core\src\algorithm.cpp:43:
In file included from C:\OpenCV\opencv-4.7.0\modules\core\src/precomp.hpp:88:
C:/OpenCV/opencv-4.7.0/modules/core/include\opencv2/core/hal/intrin.hpp:83:9: error: use of undeclared identifier âllvmâ
return llvm.cttz.i32(value, true);
^
1 error generated.
Another question about 64 bit, I downloaded the windows file from the site and got a .lib file of world. Except for Embarcadero C++ Builder 64 bit it needs to be .a file. Is there an easy way to change a lib file from .lib to .a?
I have tried lib2a but when I link the .a file I get the following error (object name may differ):
After downgrading my OpenCV version to 2.4.13 and running the CMake command adding that contrib and legacy need to be turned off I have successfully downloaded the OpenCV lib files and have added them to C++ builder. Using those lib files, I could create a Mat file where I read an image. But when I want to try imshow to show the image I get the error saying that â[bcc32c Error] Main.cpp(26): C++ requires a type specifier for all declarationsâ. How can I solve this error?
Sorry, completely forgot to reply.
I use 10.3 C++ Builder so maybe it is better to just try and build the lib files yourself. For me I used the mostly the same command as I used for 4.7.0 but I removed the extra modules. If you encounter any errors let me know and maybe I can help you.
I also had this TLIB error while compiling cURL for C++ Builder using CMake
Error: the combinations '+*' or '*+' are not allowed
The reason was unexpected and trivial:
File objects1.rsp generated by CMake contains the list of obj files required by the linker. Unfortunately the paths to these files have folders separated by / (unix style), not \ (windows style). When I replaced all chars / by \ in this file, libcurl.lib linked correctly.
I hope it will help you compile your project.