OnlineFaceRec by Shervin - visual-studio-2010

I am trying to implement the online face recognition by Shervin which is available in his website: http://www.shervinemami.co.cc/faceRecognition.html
I downloaded the zip file and tried to run it but i am not able to do it. I am using Microsoft Visual Studio 2010 Ultimate.
I am having this errors.
error LNK2019: unresolved external symbol _cvEigenDecomposite referenced in function "void __cdecl learn(char *)" (?learn##YAXPAD#Z)
error LNK2019: unresolved external symbol _cvCalcEigenObjects referenced in function "void __cdecl doPCA(void)" (?doPCA##YAXXZ)
Not sure what these errors are and how to solve it...

I don't know what OpenCV version you are using, but if we assume that you have v2.3.0 you need to link your project with the library: opencv_legacy230.lib , which is where those symbols are defined.

Related

Unresolved External Symbol OpenCV4.0 Visual Studio 2017

I'm currently trying to use Open CV 4.0 with Visual Studio 2017. I've already set the project properties as such
**C/C++ -> Additinal Include Directories**
C:\Users\admin\Documents\opencv\build\include
%(AdditionalIncludeDirectories)
**Linker -> General -> Additional Library Dependencies**
C:\Users\admin\Documents\opencv\build\x64\vc15\lib
%(AdditionalLibraryDirectories)
**Linker -> General -> Additional Dependencies**
opencv_world400d.lib
However I'm getting external symbol errors
1>stdafx.cpp
1>Generating Code...
1>ConsoleSample.obj : error LNK2019: unresolved external symbol "public: __cdecl cv::Mat::operator struct _IplImage(void)const " (??BMat#cv##QEBA?AU_IplImage##XZ) referenced in function main
1>ConsoleSample.obj : error LNK2019: unresolved external symbol "int __cdecl cv::_interlockedExchangeAdd(int *,int)" (?_interlockedExchangeAdd#cv##YAHPEAHH#Z) referenced in function "public: void __cdecl cv::Mat::release(void)" (?release#Mat#cv##QEAAXXZ)
1>C:\Users\admin\Documents\SampleCode\bin64\ConsoleSampled.exe : fatal error LNK1120: 2 unresolved externals
1>Done building project "ConsoleSample.vcxproj" -- FAILED.
I've already looked around stack overflow and a lot of them said that I had to include highgui libraries, core libraries etc.. But the thing is Open CV 4.0 for Visual Studio 2017 only came with a library called "opencv_world400d.lib".
Am I missing something?

Linking Errors after Visual Studio 2012 to 2017 migration

I am migrating my project from Visual Studio 2012 to 2017. I have selected Windows sdk V 10.0.17763.0 and and platform toolset as Visual Studio 2017 (v141) for all the projects in a solution. and target WINVER 0x0601 . Apart from this i have not made any changes .When I compile all the projects compile but i get error during Linking .There around 400 errors .I am linking the source files of static library files which belongs to other project (Added in additional include directories).Looks like most of the errors are coming from files that belongs to that project. I have even changed the toolset/sdk settings for that project. I am pretty much stuck .Unable to find out the root cause for this error .
Error LNK2019 unresolved external symbol "void __cdecl RemoveRefForStatic(class GlobalSignalSourceInfo *)" (??$RemoveRefForStatic#VGlobalSignalSourceInfo####YAXPAVGlobalSignalSourceInfo###Z) referenced in function "public: __thiscall ATL::CAtlComModule::CAtlComModule(void)" (??0CAtlComModule#ATL##QAE#XZ) CSMediaPlayer D:\CoolSign\trunk\Development\common\2008\CSMediaPlayer_CEF\COMInterface D:\CoolSign\trunk\Development\common\2008\CSMediaPlayer_CEF\COMInterface\CSMediaEngine.lib(StdAfx.obj)
Error LNK2019 unresolved external symbol "void cdecl AddRefForStatic(class GlobalSignalSourceInfo *)" (??$AddRefForStatic#VGlobalSignalSourceInfo####YAXPAVGlobalSignalSourceInfo###Z) referenced in function "long __stdcall ATL::AtlWinModuleTerm(struct ATL::_ATL_WIN_MODULE70 *,struct HINSTANCE *)" (?AtlWinModuleTerm#ATL##YGJPAU_ATL_WIN_MODULE70#1#PAUHINSTANCE__###Z) CSMediaPlayer D:\CoolSign\trunk\Development\common\2008\CSMediaPlayer_CEF\COMInterface D:\CoolSign\trunk\Development\common\2008\CSMediaPlayer_CEF\COMInterface\CSMediaEngine.lib(StdAfx.obj) 1
Error LNK2001 unresolved external symbol "void __cdecl RemoveRefForStatic(class GlobalSignalSourceInfo *)" (??$RemoveRefForStatic#VGlobalSignalSourceInfo####YAXPAVGlobalSignalSourceInfo###Z) CSMediaPlayer D:\CoolSign\trunk\Development\common\2008\CSMediaPlayer_CEF\COMInterface D:\CoolSign\trunk\Development\common\2008\CSMediaPlayer_CEF\COMInterface\CSLib.lib(criticalsection.obj) 1
Error LNK1120 18 unresolved externals CSMediaPlayer D:\CoolSign\trunk\Development\common\2008\CSMediaPlayer_CEF\COMInterface\Debug D:\CoolSign\trunk\Development\common\2008\CSMediaPlayer_CEF\COMInterface\Debug\CSMediaPlayer.dll 1

Linker errors in pcp_main example from libjingle

I'm working to get libjingle working on windows7 using visual studio. I followed GYP methodology to build lib jingle and got libs after executing the libjingle.sln file.
Now, when I'm trying to run pcp_main.cc file, I got slashed with linker errors, after some work around, I was left with 5 linker errors. Can someone help me how to resolve those errors?
Error 5 error LNK1120: 4 unresolved externals C:\Users\username\documents\visual studio
2012\Projects\PCPTest\Debug\PCPTest.exe Error 3 error LNK2001:
unresolved external symbol "protected: virtual bool __thiscall
buzz::JingleInfoTask::HandleStanza(class buzz::XmlElement const *)"
(?HandleStanza#JingleInfoTask#buzz##MAE_NPBVXmlElement#2##Z) C:\Users\username\documents\visual
studio 2012\Projects\PCPTest\PCPTest\pcp_main.obj
Error 1 error LNK2001: unresolved external symbol "public: virtual int
__thiscall buzz::JingleInfoTask::ProcessStart(void)" (?ProcessStart#JingleInfoTask#buzz##UAEHXZ) C:\Users\username\documents\visual
studio 2012\Projects\PCPTest\PCPTest\pcp_main.obj
Error 2 error LNK2019: unresolved external symbol "public: void
__thiscall buzz::JingleInfoTask::RefreshJingleInfoNow(void)" (?RefreshJingleInfoNow#JingleInfoTask#buzz##QAEXXZ) referenced in
function "public: void __thiscall
AutoPortAllocator::SetXmppClient(class buzz::XmppClient *)"
(?SetXmppClient#AutoPortAllocator##QAEXPAVXmppClient#buzz###Z) C:\Users\username\documents\visual
studio 2012\Projects\PCPTest\PCPTest\pcp_main.obj
Error 4 error LNK2019: unresolved external symbol
_imp_InternetQueryOptionW#16 referenced in function "bool __cdecl talk_base::GetIeLanProxySettings(char const *,struct
talk_base::ProxyInfo *)"
(?GetIeLanProxySettings#talk_base##YA_NPBDPAUProxyInfo#1##Z) C:\Users\username\documents\visual
studio 2012\Projects\PCPTest\PCPTest\libjingle.lib(proxydetect.obj)
My include folder is pointing to
C:\Users\username\Desktop\libjingle\trunk\testing
C:\Users\username\Desktop\libjingle\trunk\
and lib folder to
C:\Users\username\Desktop\libjingle\trunk\build\Debug\lib
Additional dependencies have absolute paths of all the available libs.
C:\Users\username\Desktop\libjingle\trunk\build\Debug\lib\audio_processing_sse2.lib
C:\Users\username\Desktop\libjingle\trunk\build\Debug\lib\bitrate_controller.lib
C:\Users\username\Desktop\libjingle\trunk\build\Debug\lib\CNG.lib
...
...
...
The source codeI'm using is present here.
http://pastebin.com/GATFYWnW
Got the answer!
The Error 4 can be removed by adding the following line
#pragma comment(lib, "Wininet.lib")
The remaining errors correspond to the jingleInfoTask.cc and JingleInfotask.h files. Its a bit surprise to see that the solution file (libjingle.sln) doesnt have these files when it built libraries. The work around would be to add the jingleinfotask.cc and jingleinfotask.h files into xmpp folder and re-build the libjingle.sln file.
This will produce the jingleinfotask.obj and required lib files. Make sure you point the generated lib file in the additional dependencies section in linker section of project properties.

Using Q_OBJECT in VS2010 project gives unresolved externals

I'm trying to use the Q_OBJECT macro in my Visual Studio 2010 Ultimate project, and it gives me unresolved external errors:
1>Application.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall MyButton::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall#MyButton##UAEHW4Call#QMetaObject##HPAPAX#Z)
1>Application.obj : error LNK2001: unresolved external symbol "public: virtual void * __thiscall MyButton::qt_metacast(char const *)" (?qt_metacast#MyButton##UAEPAXPBD#Z)
1>Application.obj : error LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __thiscall MyButton::metaObject(void)const " (?metaObject#MyButton##UBEPBUQMetaObject##XZ)
I've had a similar project using QMaker, and solved it by doing clean project and re-running qmake. The thing is, there's no "Qmake" button in VS!
I have read few articles like this one and done everything they told me to. Though it didnt really help, because I've got an existing project of a few .cpp and a few header files, and I would like to avoid creating a .pro file and moving code into it.
I've installed VS Qt add-in, it gave me new cool "Qt" button on VS panel, though didn't help with unresolved externals (probably I don't know how to use it properly).
I have ran moc with via custom build tool in VS on my Application.h file (the only one that has Q_OBJECT), but that still didn't help:
C:\Utilities\QtSDK\Desktop\Qt\4.8.1\msvc2010\bin\moc Application.h -o tmp\moc\moc_Application.cpp
What might cause my problem and how do I solve it?
I would guess that you forgot to add the file generated by MOC (moc_Application.cpp in this case) into your Visual Studio project. You have to do this to make sure it gets built. I'm pretty sure this should resolve the linker errors you see.

Building libs in VS 2010 for use in VS 2005?

I need to use WebRTC in VS 2005. As far as I've found out, I need VS 2005 SP1 for this purpose. Otherwise, two link errors appear all the time:
LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: virtual __thiscall std::exception::~exception(void)" (??1exception#std##UAE#XZ) already defined in SwitchingSampRate.obj
LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: virtual char const * __thiscall std::exception::what(void)const" (?what#exception#std##UBEPBDXZ) already defined in SwitchingSampRate.obj
I can't install SP1 for some reason. So to avoid these errors, I tried to build WebRTC lib-files in VS 2010 and then to link them to my VS 2005 solution. However, this brings about other kinds of errors and warnings (this is in 2005, again):
warning LNK4229: invalid directive '/FAILIFMISMATCH:_MSC_VER=1600' encountered; ignored
error LNK2001: unresolved external symbol "void __cdecl std::_Xlength_error(char const *)" (?_Xlength_error#std##YAXPBD#Z)
unresolved external symbol "void (__cdecl* std::_Raise_handler)(class stdext::exception const &)" (?_Raise_handler#std##3P6AXABVexception#stdext###ZA)
I wonder, if these errors could be avoided, so that I could use the libs generated in VS 2010 in my VS 2005 project.
You can't link libs to a program built with another version of visual studio.

Resources