I need help with my face recognition program.
I got these errors when I build my program:
error LNK2019: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::setSVMDetector(class std::vector<float,class std::allocator<float> > const &)" (?setSVMDetector#HOGDescriptor#cv##UAEXABV?$vector#MV?$allocator#M#std###std###Z) referenced in function "int __cdecl ppledetect(void)" (?ppledetect##YAHXZ)
error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::write(class cv::FileStorage &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)const " (?write#HOGDescriptor#cv##UBEXAAVFileStorage#2#ABV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std###Z)
error LNK1120: 11 unresolved externals
I got 11 these kinds of errors.
3 of error LNK2019 while 8 of error LNK2001 and 1 of error LNK1120.
Why is this happening?
HOGDescriptor is in opencv_objdetect.
This usually means you are missing linker dependencies (lib files)
A search shows these files you will need to add in debug:
opencv_core220d.lib
opencv_highgui220d.lib
opencv_video220d.lib
opencv_ml220d.lib
opencv_legacy220d.lib
opencv_imgproc220d.lib
If you're using Visual Studio, you can go to :
project properties -> Configuration properties -> Linker -> General
From there, set the "Additional Library Directories". This is where you enter the root directory where the lib files are located. eg: C:\program files\opencv22\lib\
You then need to go to project properties -> Configuration properties -> Linker -> Input
Under Additional Dependencies, you need to add those lib files there.
The errors mean that OpenCV is not linked correctly. Make sure you follow the instructions at http://opencv.willowgarage.com/wiki/VisualC%2B%2B.
I got same error and I resolved by previous answers.
If you're using Visual Studio: go to Project properties -> Configuration properties -> Linker -> Input -> Additional Dependencies and edit it.
You need to add "opencv_objdetect249d.lib" (I am using opencv 2.4.9 but your file name can be different, 249 can change. Look your ..\opencv\build\x64\vc10\lib directory and write your file's name: opencv_objdetect???d.lib)
Related
I managed to compile hunspell with Visual Studio and I'm having dificulties making it work.
Here's what I have done:
Project Properties -> C/C++ -> General -> Additional Include Directories and added this line: C:\src\hunspell\src\hunspell
Project Properties -> Linker -> General -> Additional Library Directories and added this line: C:\src\hunspell\msvc\Debug_dll\libhunspell
I got this error when I try to run:
cMain.obj : error LNK2019: unresolved external symbol _Hunspell_create referenced in function "public: __thiscall cMain::cMain(class wxString const &,int,class wxPoint const &,class wxSize const &,long)" (??0cMain##QAE#ABVwxString##HABVwxPoint##ABVwxSize##J#Z)
I also copied the C:\src\hunspell\msvc\Debug_dll\libhunspell\libhunspell.dll to my \Debug folder.
Anyone can help?
Thank you.
I solved the issue by adding the libhunspell.dll and libhunspell.lib to my Resource Files folder.
I am a newbie to Open Cascade.After building occt-7.3.0-vc14-64 with cmake with no error, i added inc/ in Include Directories and added win64/vc14/libd/ in Library Directories, then added only "include" in main.cpp. But after clicked debug button, i got link error as following:
Error LNK2019 unresolved external symbol "public: __cdecl
Standard_OutOfMemory::Standard_OutOfMemory(char const * const)" (??
0Standard_OutOfMemory##QEAA#QEBD#Z) referenced in function "public:
void __cdecl Standard_OutOfMemory::`default constructor closure'(void)"
(??_FStandard_OutOfMemory##QEAAXXZ)
What else should have be done?
Thanks for any help.
This error is that can't find lib that contain Standard_OutOfMemory.
Standard_OutOfMemory is a class in TKernel.dll, you should add TKernel.lib to project's Additional Dependencies, like on the image below:
I'm trying to build ACE and TAO environment but got many errors.
The procedure what I did to install ACE and TAO is:
Unzip the file (ACE+TAO+CIAO-6.1.2.zip) into the folder (C:\ACE_wrappers)
Create a config.h file in C:\ACE_wrappers\ace
Open the config.h file and type in lines:
#definenter code heree ACE_HAS_WINNT4 1
#define ACE_HAS_STANDARD_CPP_LIBRARY 1
#define ACE_HAS_MFC 1
#define THR_USE_AFX 1
#define ACE_USES_STATIC_MFC 1
#define ACE_AS_STATIC_LIBS 1
#define ACE_NO_INLINE
#include "ace/config-win32.h"
Saved it and close
Open Control Panel - > System -> Advanced system settings -> Environment Variables
Create a new system variable: ACE_ROOT, value: C:\ACE_wrappers
Create a new system variable: TAO_ROOT, value: C:\ACE_wrappers\TAO
In PATH system variable, add value: C:\Program Files\Microsoft Visual Studio 10.0\VC\bin;C:\ACE_wrappers\bin;C:\ACE_wrappers\lib;C:\ACE_wrappers\TAO\bin;
so the value is:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;%USERPROFILE%.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft Visual Studio 10.0\VC\bin;C:\ACE_wrappers\bin;C:\ACE_wrappers\lib;C:\ACE_wrappers\TAO\bin;
Start Visual Stiduo 2010
Open TAO_ACE_vc10.sln solution in C:\ACE_wrappers\TAO
Select Release in solution configuration (on the menu bar)
Select all project and right-click then choose Properties
Set Configuration Properties -> General -> Use of MFC to Use MFC in a Shared DLL
In Configuration Properties -> VC++ Directories -> Executable Directories add C:\ACE_wrappers\bin;
In Configuration Properties -> VC++ Directories -> Include Directories add C:\ACE_wrappers
C:\ACE_wrappers\TAO
C:\ACE_wrappers\TAO\tao
C:\ACE_wrappers\TAO\orbsvcs
C:\ACE_wrappers\TAO\orbsvcs\orbsvcs
In Configuration Properties -> VC++ Directories -> Library Directories add
C:\ACE_wrappers\ace
C:\ACE_wrappers\TAO\tao
C:\ACE_wrappers\TAO\orbsvcs\orbsvcs
Select every project and check whether its Configuration Properties -> General -> Configuration Type is Dynamic Library (.dll), if it is, then change to Static library (.lib)
But if it is Application(.exe) or Utility, then I do not change. Like the Scheduling_Service project which has error during build.
Build -> Build Solution
After a long time, most projects are built successfully. The Scheduling_Service, Time_Service_Clerk, NT_Notify_Service, Naming_Service (, and maybe there are few other projects) have errors (error LNK2001: unresolved external symbol "__declspec(dllimport) public:......).
1>Scheduling_Service.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall TAO_ORB_Manager::~TAO_ORB_Manager(void)" (__imp_??1TAO_ORB_Manager##QAE#XZ) referenced in function __unwindfunclet$??0TAO_Scheduling_Service##QAE#XZ$0
1>Scheduling_Service.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall TAO_ORB_Manager::TAO_ORB_Manager(class CORBA::ORB *,class PortableServer::POA *,class PortableServer::POAManager *)" (__imp_??0TAO_ORB_Manager##QAE#PAVORB#CORBA##PAVPOA#PortableServer##PAVPOAManager#4##Z) referenced in function "public: __thiscall TAO_Scheduling_Service::TAO_Scheduling_Service(void)" (??0TAO_Scheduling_Service##QAE#XZ)
1>Scheduling_Service.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CosNaming::Name::~Name(void)" (__imp_??1Name#CosNaming##UAE#XZ) referenced in function "public: int __thiscall TAO_Scheduling_Service::init(int,char * * const)" (?init#TAO_Scheduling_Service##QAEHHQAPAD#Z)
1>TAO_RTSchedd.lib(Scheduler_Factory.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall CosNaming::Name::~Name(void)" (__imp_??1Name#CosNaming##UAE#XZ)
1>Scheduling_Service.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: struct CosNaming::NameComponent & __thiscall TAO::unbounded_value_sequence::operator[](unsigned int)" (__imp_??A?$unbounded_value_sequence#UNameComponent#CosNaming###TAO##QAEAAUNameComponent#CosNaming##I#Z) referenced in function "public: int __thiscall TAO_Scheduling_Service::init(int,char * * const)" (?init#TAO_Scheduling_Service##QAEHHQAPAD#Z)
1>TAO_RTSchedd.lib(Scheduler_Factory.obj) : error LNK2001: unresolved external symbol "__declspec(dllimport) public: struct CosNaming::NameComponent & __thiscall TAO::unbounded_value_sequence::operator[](unsigned int)" (__imp_??A?$unbounded_value_sequence#UNameComponent#CosNaming###TAO##QAEAAUNameComponent#CosNaming##I#Z)
Does anyone know this problem? Thank you very much.
You shouldn't use #define ACE_AS_STATIC_LIBS 1 unless you are using a Visual Studio project which are generated for static usage. At the moment you want to do a static build you have to regenerate the Visual Studio projects with MPC
I have two C++ projects which each form a library to be referenced by a third project all as part of a Visual Studio solution.
The two libraries were written by someone else who also provided his own VS solution which included a project which acts as a demo for some of the library functions. I have successfully gotten these to compile and run. I am trying to develop a Windows application using Windows Forms which will make use of the libraries. Upon including the two necessary headers,
#include "corelib.h"
#include "corbit.h"
and trying to build the code, I receive 2 link errors:
SatTrack_v0.1.obj : error LNK2028: unresolved token (0A000010) "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __clrcall Zeptomoby::OrbitTools::cGeo::ToString(void)const " (?ToString#cGeo#OrbitTools#Zeptomoby##$$FUBM?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##XZ) referenced in function "void __clrcall `dynamic initializer for 'const Zeptomoby::OrbitTools::cGeo::`vftable'''(void)" (???__E??_7cGeo#OrbitTools#Zeptomoby##6B###YMXXZ#?A0xc222cabd##$$FYMXXZ)
SatTrack_v0.1.obj : error LNK2019: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __clrcall Zeptomoby::OrbitTools::cGeo::ToString(void)const " (?ToString#cGeo#OrbitTools#Zeptomoby##$$FUBM?AV?$basic_string#DU?$char_traits#D#std##V?$allocator#D#2##std##XZ) referenced in function "void __clrcall `dynamic initializerfor 'const Zeptomoby::OrbitTools::cGeo::`vftable'''(void)" (???__E??_7cGeo#OrbitTools#Zeptomoby##6B###YMXXZ#?A0xc222cabd##$$FYMXXZ)
C:\Users\Satellite Tracking\Software\SatTrack_v0.1\Win32\(Configuration)\SatTrack_v0.1.exe : fatal error LNK1120: 2 unresolved externals
I've read through What is an undefined reference/unresolved external symbol error and how do I fix it? and I thought I linked the necessary libraries. I've gone to the project Properties | Framework and References and added the libraries. I've also added the Additional Include Directories under Properties | Configuration Properties | C/C++ | General. Also, under Linker | General I've included the proper location in Additional Library Directories and I think I have the proper Additional Dependencies under Linker | Input. In general, I've gone through many of the project properties and tried to match them to the property settings of the working demo project, but the linker problem remains.
Am I simply still missing a link somewhere or is the problem more complicated than that? Because I do have the the demo solution compiling, is there a better way to take the link settings than manually going through all of them and trying to match those which are appropriate? I've been stuck on this problem for a couple days and can't figure out what I'm missing. Where should I go from here?
While trying to compile program, that uses zlib, i got following errors:
Error 1 error LNK2019: unresolved
external symbol _compress referenced
in function "void __cdecl
save_image_in_pakfile(class
std::basic_ofstream > &,struct
_IplImage *)" (?save_image_in_pakfile##YAXAAV?$basic_ofstream#DU?$char_traits#D#std###std##PAU_IplImage###Z) buffer_management.obj
Error 2 error LNK2001: unresolved
external symbol
_compress fern_based_point_classifier.obj
And two more same errors but related to uncompress function.
I use the vs2008 C++, and at the project properties I added in
C/C++ : Additional include directories the path to header files of zlib.
And at linker properties I added at additional dependencies:
zlibwapi.lib and zlibstat.lib files.
How to resolv the problem?
If I made some mistakes please show me them..