I am updating some old code. Everything compiled fine. But I am stuck on (I think) simple thing.
Error LNK2001: unresolved external symbol "public: __thiscall CBaseVideoRenderer"
I have built the latest DirectShow lib both in Unicode and MBCS. And it still gives me this compile error. It gives me no error in the code. What is here wrong?
EDIT:
Here is the file where CBaseVideoRendere.
https://github.com/pixelspark/tjshow/blob/master/ShowControl/TJShow/src/view/tjtexturerenderer.h
(I have updated the DirectShow. But it is not ready to go in the git. So there is a different version)
Related
I have a project which uses soci for DB access. The project was originally developed with soci 3.2.2.
Now I switched to soci 3.2.3 and get the following linker error messages:
error LNK2001: unresolved external symbol "public: class soci::details::once_temp_type & __thiscall soci::details::once_temp_type::operator,(class soci::details::type_ptr<class soci::details::use_type_base> const &)" (??Qonce_temp_type#details#soci##QAEAAV012#ABV?$type_ptr#Vuse_type_base#details#soci###12##Z)
error LNK2001: unresolved external symbol "public: void __thiscall soci::details::statement_impl::exchange_for_rowset(class soci::details::type_ptr<class soci::details::into_type_base> const &)" (?exchange_for_rowset#statement_impl#details#soci##QAEXABV?$type_ptr#Vinto_type_base#details#soci###23##Z)
error LNK2001: unresolved external symbol "public: class soci::details::prepare_temp_type & __thiscall soci::details::prepare_temp_type::operator,(class soci::details::type_ptr<class soci::details::use_type_base> const &)" (??Qprepare_temp_type#details#soci##QAEAAV012#ABV?$type_ptr#Vuse_type_base#details#soci###12##Z)
I use Visual Studio 2010 on a Windows machine.
Does somebody has an idea what could be the issue?
Bests
The Solution was using the newest error corrected Soci library from github and not the stable download version.
Bests
I've got a C++ project in Visual Studio 2010 where I'm porting my code from the old yaml-cpp 0.3 API to the new 0.5 API. I've set up Boost, built the new DLLs with CMake, set up the include and library paths, updated all the code to match the new API, and everything compiles fine.
However, when it reaches linking, I'm met with a barrage of linker errors like this:
error LNK2001: unresolved external symbol "public: static bool __cdecl YAML::convert<bool>::decode(class YAML::Node const &,bool &)"
error LNK2001: unresolved external symbol "private: void __thiscall YAML::detail::node_data::insert_map_pair(class YAML::detail::node &,class YAML::detail::node &)"
error LNK2001: unresolved external symbol "public: void __thiscall YAML::detail::memory_holder::merge(class YAML::detail::memory_holder &)"
error LNK2001: unresolved external symbol "public: class YAML::detail::node & __thiscall YAML::detail::memory::create_node(void)"
error LNK2001: unresolved external symbol "public: void __thiscall YAML::detail::node_data::mark_defined(void)"
error LNK2001: unresolved external symbol "public: void __thiscall YAML::detail::node_data::set_null(void)"
...
It looks like not all symbols are being exported to the DLL, but I don't know how to fix it. I've tried cleaning everything, rebuilding, Debug/Release, different VS versions, etc. With yaml-cpp 0.3 it all worked fine, but I really want the new API. These are the settings I'm using in CMake to build the library:
APPLE_UNIVERSAL_BIN = false
BUILD_SHARED_LIBS = true
MSVC_SHARED_RT = true
MSVC_STHREADED_RT = false
YAML_CPP_BUILD_CONTRIB = false
YAML_CPP_BUILD_TOOLS = false
This is a known issue. You can follow the issue page on the project's page.
I am trying to build an OpenCV program which uses SURF matching algorithm, the code is in the following link :
http://feelmare.blogspot.ro/2011/10/sift-matching-c-source-code-using.html
However, I am obtaining 2 errors regarding some external symbols : _cvExtractSurf and _cvSURFParams.
error LNK2019: unresolved external symbol _cvExtractSURF referenced in function "public: bool __thiscall CMareMatchingClass::ExtractBGsurf(struct _IplImage *)" (?ExtractBGsurf#CMareMatchingClass##QAE_NPAU_IplImage###Z)
error LNK2019: unresolved external symbol _cvSURFParams referenced in function "public: __thiscall CMareMatchingClass::CMareMatchingClass(void)" (??0CMareMatchingClass##QAE#XZ)
Do you know how can I solve this errors? I am running the code by using opencv 2.3.0 in visual studio 2010 in Windows 7 - 64 bit.
You didn't link a needed library - try to link all OpenCV libraries in project settings. See documentation.
I built the v8 libraries on visual studio 2005 in release mode, put the resulting .lib files (in release mode) and compiled my project against them.
While everything is working fine in debug mode (compiling and running correctly), in release mode I get the following link errors (as if the lib files are not there).
error LNK2001: unresolved external symbol "public: class v8::Local<class v8::Boolean> __thiscall v8::Value::ToBoolean(void)const " (?ToBoolean#Value#v8##QBE?AV?$Local#VBoolean#v8###2#XZ)
error LNK2001: unresolved external symbol "public: bool __thiscall v8::Value::IsInt32(void)const " (?IsInt32#Value#v8##QBE_NXZ)
error LNK2001: unresolved external symbol "public: bool __thiscall v8::Value::IsNumber(void)const " (?IsNumber#Value#v8##QBE_NXZ)
error LNK2001: unresolved external symbol "public: bool __thiscall v8::Value::IsBoolean(void)const " (?IsBoolean#Value#v8##QBE_NXZ)
error LNK2001: unresolved external symbol "public: bool __thiscall v8::Value::IsObject(void)const " (?IsObject#Value#v8##QBE_NXZ)
error LNK2001: unresolved external symbol "public: bool __thiscall v8::Value::IsArray(void)const " (?IsArray#Value#v8##QBE_NXZ)
error LNK2001: unresolved external symbol "public: bool __thiscall v8::Value::IsFunction(void)const " (?IsFunction#Value#v8##QBE_NXZ)
error LNK2001: unresolved external symbol "public: bool __thiscall v8::Value::IsNull(void)const " (?IsNull#Value#v8##QBE_NXZ)
My linker properties have the following additional depencies.
msvcrt.lib ntstc_msvcrt.lib Psapi.lib winmm.lib Ws2_32.lib $(SolutionDir)\external_libs\release\v8.lib
and my $(SolutionDir)\external_libs\release folder containst the files:
v8.lib, v8_base.lib, v8_snapshot.lib
Any help would be appreciated.
In Visual Studio the build options are separate for debug and release builds. You probably set everything up properly for debug mode, but not for release mode, hence the errors.
I forget exactly how things are layed out in VS2005, but in VS2008, there is a combobox at the top of the solution properties dialog that lets you choose between debug/release/all configurations.
In other words, you will have to add the additional dependencies to the linker properties section in release mode. Alternatively, in the future, make all changes with the configuration set to All configurations.
Likely cause: The command switches and defines you used to build the v8 lib don't match those that you are using to build the code consuming it.
As an aside, if you are using the vs2005 CRT, you don't need this: ntstc_msvcrt.lib
Martyn
Basically, what's happening is this: I have a VC6 workspace (contains 3 projects total), and after NOT being able to succesfully port it into VS2010, I installed XP on a virtual machine (Win 7 on host machine), and installed VS6 on the devbox.
From there, I was able to get past compilation errors, and land headfirst into a whole slew of linker errors...
and I have no idea what's wrong. If anyone could help me with this it would be tremendously appreciated!
(an excert from the build log, there's 41 linker errors total...)
>Linking...
MainFrm.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall ReportMenuBuilder::~ReportMenuBuilder(void)" (??1ReportMenuBuilder##UAE#XZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: __thiscall ReportMenuBuilder::ReportMenuBuilder(void)" (??0ReportMenuBuilder##QAE#XZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: bool __thiscall ReportMenuBuilder::Build(bool)" (?Build#ReportMenuBuilder##QAE_N_N#Z)
MainFrm.obj : error LNK2001: unresolved external symbol "public: int __thiscall CReportMultiDocTemplate::GetDocumentCount(void)const " (?GetDocumentCount#CReportMultiDocTemplate##QBEHXZ)
MainFrm.obj : error LNK2001: unresolved external symbol "public: class CString __thiscall ReportMenuBuilder::GetFilespecGivenID(unsigned int)const " (?GetFilespecGivenID#ReportMenuBuilder##QBE?AVCString##I#Z)
Only thing I can think of is apparently the projects are having trouble seeing the necessary files from the other projects, but I don't know why.
My first guess would be you haven't added the .lib file to the additional imports of the other projects. If you have dumpbin the binaries and see if you see the export.