Linker error LNK2019 (unresolved symbol) with OpenCV 2.4, CvBlob library, and Visual Studio 2012 RC - opencv

I've spent the last hour or two trying to hunt this problem down and can't seem to get it right. I am using OpenCV with MS VS 2012 RC, and to this point it has worked quite well (one bug dealing with the newer Mat container, but fine otherwise). I have a previously written application I am trying to port (from GCC/G++), which used the cvblob.dll library from here. I have recompiled the cvblob library with VS2012 (my previous version was compiled with MinGW and worked flawlessly), and managed to create both a DLL and an import library .LIB.
The application compiles properly, but the one spot where I use the cvblob library is now my source of error, because the linker cannot find the symbol for the cvLabel function in the library. This is the complete error message I get from VS2012:
ConsoleApplication1.cpp
1> Generating Code...
1>imageinput.obj : error LNK2019: unresolved external symbol _cvLabel referenced in function "public: class std::vector,class std::allocator > > _thiscall ImageInput::getROI(class cv::Mat,class cv::Mat)" (?getROI#ImageInput##QAE?AV?$vector#V?$Rect#H#cv##V?$allocator#V?$Rect_#H#cv###std###std##VMat#cv##0#Z)
1>C:\Users\Jake\Documents\Visual Studio 2012\Projects\ConsoleApplication1\Debug\ConsoleApplication1.exe : fatal error LNK1120: 1 unresolved externals
I'm not certain whether this is a problem with the cvblob library itself, my current binary for it, or just the process I used to compile it. I will gladly furnish any information I can upon request. Thanks in advance for your advice!

You obviously didn't link needed library in project settings. Try to add all OpenCV/CvBlob libs in linker properties of your prooject. See docs.
Also look at this discussion.

Related

OpenCV 4.5.5 building from source with GStreamer failed

When I want to build OpenCV 4.5.5 from source with GStreamer, I am getting below error:
53>cap_gstreamer.obj : error LNK2019: unresolved external symbol __imp_gst_audio_info_from_caps referenced in function "public: bool __cdecl cv::GStreamerCapture::grabAudioFrame(void)" (?grabAudioFrame#GStreamerCapture#cv##QEAA_NXZ)
53>D:\opencv\build\bin\Release\opencv_videoio455.dll : fatal error LNK1120: 1 unresolved externals
53>Done building project "opencv_videoio.vcxproj" -- FAILED.
Before it works well, but in the new version I am getting this error, I also have updated the GStreamer version to the latest (1.18.5) and again got the same problem.
Apparently a known issue in this release, and there should already be a patch in the release (?)
https://github.com/opencv/opencv/issues/21393
https://github.com/opencv/opencv/pull/21294
There are efforts to get (some) audio support into OpenCV's videoio. This seems to be a side effect of that work.
In general, browse the issues using salient identifiers from your error message. You might find that someone already reported it (like above).

Not Able To Compile Neon Code on Xcode: "bad instruction"

I have a code base which under Xcode get the error "bad instruction" for every NEON instruction I call. It basically seems like NEON is not detected.
I am attempting to build a static library, I went to New Project, selected Cocoa Touch Static Library, then added my existing files.
Everything I'm reading indicates that NEON should be already enabled. I removed all references to armv6, and am targeting iOS 5.1
Also the code in question is all contained as routines defined in ".s" files -- pure assembly. I am not using the intrinsic method calls.
this is the error which I get whenever I try to run the code:
unknown directive .fpu neon
Command /Applications/Xcode.app/Contents/Developer/Toolchains/
XcodeDefault.xctoolchain /usr/bin/clang failed with exit code 1
also when I delete .fpu neon command from my code, it compiles and I get the .o file but then it fails to link as I still am not able to use the programs defined in the code file.
Try the answer on my similar question https://stackoverflow.com/a/10507325/571778
Sort answer, in my case, was I was porting assembly from another compiler. A few points:
Xcode requires all lower case instructions
The pseudo-ops are different (try http://www.shervinemami.info/armAssembly.html#template)
you must start your assembly function names with "_", because that's how the linker finds them (in C, call "foo()", but in ASM name your function "_foo")

OpenCV with Microsoft Kinect SDK (C++)

Can anyone share how to use OpenCV with C++ SkeletalViewer sample ?
I am using OpenCV2.3 with with SkeletalViewer sample. However, I got the following errors while trying to create an image using cvCreateImage();
error LNK2001: unresolved external symbol _cvCreateImage C:\Users\Public\Documents\Microsoft Research KinectSDK Samples\NUI\SkeletalViewer - Copy\CPP\NuiImpl.obj SkeletalViewer
error LNK1120: 1 unresolved externals C:\Users\Public\Documents\Microsoft Research KinectSDK Samples\NUI\SkeletalViewer - Copy\CPP\Debug\SkeletalViewer.exe SkeletalViewer
Thanks a lot!
It sounds like you haven't added the library to your project. Right-click your project and go to Properties. Then go to Linker >> General >> Additional Library Directories, set this to
"$(YOUR_OPENCV_ROOT)\lib". Next, go to Linker >> Input >> Additional Dependencies and make sure opencv_core230.lib (or opencv_core231.lib, which ever 2.3.x version you are using) is in there.
Also, I would highly suggest using the C++ interface as it has more functionality than the C interface especially in OpenCV 2.3.x.
Hope that helps!

compiling delphi-pi

After Downloading the source, tried to compile the code.
The first bump was missing Jedi components, so downloaded jcl-2.2.1.3817-partnerdvd
Next step was installing , which was fine.
Now After Compiling , the error message is :
[DCC Fatal Error] Utils.pas(4): F2051
Unit JclCompilerUtils was compiled
with a different version of
JclSysUtils.IJclCommandLineTool
tried to download diffrenct versions, however the owner of the code claim it was compiled with 2.2.
Ideas how to resolve this?
edit: i just removed some references to the jedi from the library path, i hope didn't do any damage. still no go.
EDIT 2: downloaded the 0.57 and not the default resulted in:
[DCC Fatal Error] Utils.pas(4): F1026
File not found: 'JclBorlandTools.dcu'
now it seems as a simple version problem with jcl, ill reinstall(again).
Most Delphi error and warning messages are pretty clear, but "Compiled with a different version" errors are one of the few exceptions. What it really means is:
Something in Unit JclSysUtils (or one of its dependencies) has changed, and Unit JclCompilerUtils, which has a dependency on JclSysUtils, needs to be recompiled now, but only the DCU for it is available. Unable to locate the PAS file to recompile it.
Try making sure that the original source code for all the JCL units is available to the compiler.
I have checked my settings. I have compiled latest revision of delphipi using JCL 2.2.1.3886.
My library path contains following paths:
C:\Users\Public\Documents\Soft Gems\Virtual Treeview\Source
C:\Components\jcl-2.2.1.3886\lib\d14
C:\Components\jcl-2.2.1.3886\source\include
Delphipi depends three external libraries which are JCL, dxgettext and Virtual Treeview and links to these libraries are listed in the homepage of the project. I think you should check double check your JCL installation and library paths. Sorry, there is nothing else I can do about this. Good luck.

Devpartner Instrumentation for Code coverage causing linker errors

So I've got a Visual studio 2005 solution that contains a C# project (test driver - creates exe) and 7 C++ Projects (dll's).
This solution builds fine up to this point.
I have DevPartner studio 8.2 installed. I am trying to generate test coverage on the entire solution which requires me to instrument native c++ code during builds. when I turn this DevPartner option on, the build produces linker errors.
Does anyone have experience with this?
For example:
Error 25 error LNK2001: unresolved external symbol "public: __thiscall IntLong::IntLong(class BufObjBase *,int,int,unsigned char,wchar_t const *,bool)" (??0IntLong##QAE#PAVBufObjBase##HHEPB_W_N#Z) X.obj
A co-worker figured this out.
In case anyone else runs into this problem:
There is a dependency chain in the project between dlls, other dlls, and libraries. Under a normal build, visual studio is smart enough to find the libraries. With DevPartner inserting its instrumentation, it isn't.
Make sure all additional dependencies are explicitly specified in (properties on project getting the link error) -> Linker -> input -> Additional Dependencies.

Resources