OpenCV 2.4.6 linker error LNK2001 - opencv

I am trying to run the opencv surf implementation here in VS 2013.
I've already arranged the libraries in Linker->Input for example opencv_core246.lib for release and opencv_core246d.lib for debug.
But when I try to run the program, I getting the following error:
Error 1 error LNK2001: unresolved external symbol "public: __thiscall
cv::SIFT::SIFT(int,int,double,double,double)"
(??0SIFT#cv##QAE#HHNNN#Z) C:...\Documents\Visual Studio
2013\Projects\surftest\surftest\main.obj surftest
I already googled this error but found nothing useful.
Is there anyone knowing the reason for this error? Thanks in advance.

You need to link it with
opencv_features2d246d.lib
opencv_nonfree246d.lib
for debug and for release
opencv_features2d246.lib
opencv_nonfree246.lib

Related

Unresolved external symbol WppAutoLogTrace when building a driver with Dmf Framework

I'm trying to build a driver with Microsoft Dmf Framework https://github.com/microsoft/DMF
I builded Dmf from the provided sln file in this repository. It results in DmfK.lib (I build a kernel mode driver), then I add this lib to my driver project.
But I have 27 times the same linker error "unresolved external symbol WppAutoLogTrace" from different functions of this lib, ie:
Error LNK2019 unresolved external symbol WppAutoLogTrace referenced in function "long __cdecl HashTable_ContextInitialize(struct DMFMODULE__ *)" (?HashTable_ContextInitialize##YAJPEAUDMFMODULE__###Z) Main (Main\Main) C:\Data\Development\MyDriver\Source\Main\DmfK.lib(Dmf_HashTable.obj)
I found no relevant information about this function over the internet, I can't figure out which other lib to include. Is this a problem with a missing lib or an issue with the DmfK.lib build ?
I finally found the solution:
WppAutoLogTrace is implemented in WppRecorder.lib

Error Cross Compiling: hidden symbol ... final link failed

I am getting the following error when compiling opencv with ffmpeg.
..../arm-none-linux-gnueabi/bin/ld: ../../bin/opencv_test_core: hidden symbol `__sync_val_compare_and_swap_4' in ..../arm-none-linux-gnueabi/bin/ld: final link failed: Nonrepresentable section on output
collect2: ld returned 1 exit status
I have no idea what this means. How do I fix this?
Edit:
I am cross compiling for ARM using codesourcery's arm-2009q3 compiler.
I using cmake and make to compile.
Please check all the libraries that you use and go through this stackoverflow thread as well.
To me, I got the below error when I migrated my product to new GCC version (3.3.3 to 4.5.4)
hidden symbol `__clz_tab' in /../lib/gcc/mipsel-unknown-linux-uclibc/4.5.4/libgcc.a(_clz.o) is referenced by DSO
Later I found that one of the library that I tried to link was built using GCC 3.3.3. After building the other library under GCC 4.5.4, the 'hidden symbol' error disappeared.

Error installing opencv-3.0.0-beta on Ubuntu 14.04

I am new to opencv and i am trying to install opencv-3.0.0-beta on ubuntu 14.04. When running make command, I get an error at 54%.I followed the same steps mentioned in http://docs.opencv.org/trunk/doc/tutorials/introduction/linux_install/linux_install.html. but I still get an error.
Below is the error message I'm getting.
/usr/bin/ld:
../../../3rdparty/ippicv/unpack/ippicv_lnx/lib/ia32/libippicv.a(jmp_ippiResizeGetBufferSize_16s_as.s.o):
relocation R_386_GOTOFF against undefined symbol
`ippicvJumpIndexForMergedLibs' can not be used when making a shared
object /usr/bin/ld: final link failed: Bad value collect2: error: ld
returned 1 exit status make[2]: * [lib/libopencv_imgproc.so.3.0.0]
Error 1 make1: [modules/imgproc/CMakeFiles/opencv_imgproc.dir/all]
Error 2 make: ** [all] Error 2
Please help in solving it.
Thanks
It looks like your IPP configuration bugs. If you don't need IPP, you might want to rerun the cmake command with this option WITH_IPP=OFF.
Further reading here about deactivate IPP and here to properly configure IPP.

Emscripten clang hello_world.cpp link error

I am trying to follow the tutorial on Emscripten setup.I have installed the SDK and now trying to test clang compilation.
Trying simple : clang tests/hello_world.cpp I am getting the following error:
c:\Program Files\Emscripten\emscripten\1.13.0>clang++
tests/hello_world.cpp hello_world-005255.o : error LNK2019:
unresolved external symbol printf referenc ed in function main LINK :
error LNK2001: unresolved external symbol mainCRTStartup hell.exe :
fatal error LNK1120: 2 unresolved externals clang++.exe: error: linker
command failed with exit code 1120 (use -v to see inv ocation)
I am executing the command in VS 2010 cmd and my system is 64bit (Emscripten version is 64bit too)

fail to build Opencv in windows using code:block

Following this link. I am stuck in the last two steps during setting up my workstation.
As a compiler I use Code:Block MinGW; I have already generated the compiled opencv files, now I need to build the sln file in Windows. I use Code Block to build this OpenCV Project File in the path D:\OpenCV\Build\Opencv, where I put the generated bin file after using Cmake.
During the building, it stopped at 40%, saying;
Linking CXX executable ....\bin\opencv_perf_core.exe
c:/codeblock/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe:
warning: auto-importing has been activated without
--enable-auto-import specified on the command line. This should work unless it involves constant data structures referencing symbols from
auto-imported DLLs. Cannot export _ZN12_GLOBAL__N_13ROp3allEv: symbol
not found Cannot export _ZN12_GLOBAL__N_17CmpType3allEv: symbol not
found collect2: ld returned 1 exit status mingw32-make.exe[2]: *
[bin/opencv_perf_core.exe] Error 1 mingw32-make.exe1: *
[modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
mingw32-make.exe: * [all] Error 2 Info: resolving vtable for
cv::_OutputArray by linking to imp_ZTVN2cv12_OutputArrayE
(auto-import) Info: resolving vtable for cv::_InputArray by linking to
imp_ZTVN2cv11_InputArrayE (auto-import) Info: resolving vtable for cv::Exception by linking to imp_ZTVN2cv9ExceptionE (auto-import)
Creating library file: ....\bin\libopencv_perf_core.dll.a Process
terminated with status 2 (14 minutes, 29 seconds) 0 errors, 3 warnings
How can I solve this problem?
Unfortunately, there's not much you can do, according to http://code.opencv.org/issues/2523.
You will have to use a recent version of MinGW. It builds fine using the latest MinGW shipping with GCC 4.7.2.
This issue seems to have been introduced in OpenCV 2.4.3 as it is said version 2.4.2 builds fine.

Resources