VC++ 6 Linker Errors - c++

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.

Related

Trouble compiling gloox library project in Visual Studio 2010

I'm having trouble compiling gloox in VS 2010. I'm getting followinng error report:
1>------ Build started: Project: gloox-1.0, Configuration: Release Win32 ------
Creating library C:\Install\gloox-1.0.13\Release\gloox-1.0.lib and object C:\Install\gloox-1.0.13\Release\gloox-1.0.exp
1>adhoc.obj : error LNK2001: unresolved external symbol "public: virtual class gloox::IOData * __thiscall gloox::IOData::clone(void)const " (?clone#IOData#gloox##UBEPAV12#XZ)
1>adhoc.obj : error LNK2001: unresolved external symbol "public: virtual class gloox::Tag * __thiscall gloox::IOData::tag(void)const " (?tag#IOData#gloox##UBEPAVTag#2#XZ)
1>adhoc.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall gloox::IOData::~IOData(void)" (??1IOData#gloox##UAE#XZ)
1>adhoc.obj : error LNK2001: unresolved external symbol "public: __thiscall gloox::IOData::IOData(class gloox::Tag const *)" (??0IOData#gloox##QAE#PBVTag#1##Z)
1>C:\Install\gloox-1.0.13\Release\gloox-1.0.dll : fatal error LNK1120: 4 unresolved externals
Could someone help me, what am I missing here? I'm new to C++ programming and new VS user so any help would be highly appreciated.
Right click project > add > Existing File.
Then Add iodata.cpp and iodata.h.
This solved my problem.

LNK2019 error using Nite and OpenNI

I haven't ever seen the error of LNK 2019 before and now I encounter it when i try to link the code that i get from Nite.
The error is...
1>kinect.obj : error LNK2019: unresolved external symbol __imp__niteShutdownHandTracker referenced in function "public: void __thiscall nite::HandTracker::destroy(void)" (?destroy#HandTracker#nite##QAEXXZ)
1>kinect.obj : error LNK2019: unresolved external symbol __imp__niteStartHandTracking referenced in function "public: enum nite::Status __thiscall nite::HandTracker::startHandTracking(class nite::Point3f const &,short *)" (?startHandTracking#HandTracker#nite##QAE?AW4Status#2#ABVPoint3f#2#PAF#Z)
1>kinect.obj : error LNK2019: unresolved external symbol __imp__niteReadHandTrackerFrame referenced in function "public: enum nite::Status __thiscall nite::HandTracker::readFrame(class nite::HandTrackerFrameRef *)" (?readFrame#HandTracker#nite##QAE?AW4Status#2#PAVHandTrackerFrameRef#2##Z)
1>kinect.obj : error LNK2019: unresolved external symbol __imp__niteHandTrackerFrameRelease referenced in function "public: void __thiscall nite::HandTrackerFrameRef::release(void)" (?release#HandTrackerFrameRef#nite##QAEXXZ)
1>kinect.obj : error LNK2019: unresolved external symbol __imp__niteStartGestureDetection referenced in function "public: enum nite::Status __thiscall nite::HandTracker::startGestureDetection(enum nite::GestureType)" (?startGestureDetection#HandTracker#nite##QAE?AW4Status#2#W4GestureType#2##Z)
1>D:\AcerUser\Documents\Visual Studio 2013\Projects\kinect\Debug\kinect.exe : fatal error LNK1120: 11 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
how to solve it?
Thanks
If you get error LNK2019 from Visual Studio Console output, you might building your project for Win32 platform on your 64bit Windows, try swiching to x64.
IF you are Using Visual Studio GO TO ->Build --> (thats where you change or create win32/x64
Configuration Manager
Are you sure your application is being linked against the corresponding libraries?
Somewhere in your OpenNI and Nite installation, there must be a folder containing .lib files. You have to specify this path in the additional library directories in your project's property page. If it still doesn't work afterwards, you should add the names of these libraries in the additional dependencies.

Linker errors when using yaml-cpp 0.5 DLL

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.

Bullet Physics Engine static library installation issues

hey so i just downloaded bullet 2.78, and took the following steps:
unziped and found this tutorial
followed the steps exactly for Cmake, except i found the pictures in the tutorial had some things checked like INSTALL LIBS and i didn't so I ended up checking EVERYTHING possible.
Went into the newly generated BULLET_PHYSICS.vcxproj and built it under debug and release
Saw i had a bunch of new libs in the lib folder in msvn/BulletBuild/lib but did nothing with them
Followed the rest of the steps in the tutorial exactly for setting up the actual project
Tried to build the last line of code: FAIL
Wondered Do i NEED the dlls, because only .libs and pdbs showed up in the lib folder, and the tutorial didn't mention em
My only experience in rebuilding libraries is through SFML by building its msvn files included in the download and using the resulting dynamic lib and dll files. The instructions in the tutorial are very different however. (If someone could explain to me how this works it would be GREAT)
I followed the instructions exactly, multiple times but i'm not sure what i'm missing. The build works if i comment out the line of code in main but keep the include, but when i keep it i get this:
1>BulletTestApp.obj : error LNK2001: unresolved external symbol "void * __cdecl btAlignedAllocInternal(unsigned int,int)" (?btAlignedAllocInternal##YAPAXIH#Z)
1>BulletTestApp.obj : error LNK2001: unresolved external symbol "void __cdecl btAlignedFreeInternal(void *)" (?btAlignedFreeInternal##YAXPAX#Z)
1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btConvexInternalShape::getAabbSlow(class btTransform const &,class btVector3 &,class btVector3 &)const " (?getAabbSlow#btConvexInternalShape##UBEXABVbtTransform##AAVbtVector3##1#Z)
1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall btCollisionShape::serialize(void *,class btSerializer *)const " (?serialize#btCollisionShape##UBEPBDPAXPAVbtSerializer###Z)
1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: __thiscall btPolyhedralConvexShape::btPolyhedralConvexShape(void)" (??0btPolyhedralConvexShape##QAE#XZ)
1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual __thiscall btPolyhedralConvexShape::~btPolyhedralConvexShape(void)" (??1btPolyhedralConvexShape##UAE#XZ)
1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btConvexInternalShape::setLocalScaling(class btVector3 const &)" (?setLocalScaling#btConvexInternalShape##UAEXABVbtVector3###Z)
1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btCollisionShape::getBoundingSphere(class btVector3 &,float &)const " (?getBoundingSphere#btCollisionShape##UBEXAAVbtVector3##AAM#Z)
1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getAngularMotionDisc(void)const " (?getAngularMotionDisc#btCollisionShape##UBEMXZ)
1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getContactBreakingThreshold(float)const " (?getContactBreakingThreshold#btCollisionShape##UBEMM#Z)
1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btCollisionShape::serializeSingleShape(class btSerializer *)const " (?serializeSingleShape#btCollisionShape##UBEXPAVbtSerializer###Z)
1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btBoxShape::getAabb(class btTransform const &,class btVector3 &,class btVector3 &)const " (?getAabb#btBoxShape##UBEXABVbtTransform##AAVbtVector3##1#Z)
1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btBoxShape::calculateLocalInertia(float,class btVector3 &)const " (?calculateLocalInertia#btBoxShape##UBEXMAAVbtVector3###Z)
1>BulletTestApp.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall btPolyhedralConvexShape::initializePolyhedralFeatures(void)" (?initializePolyhedralFeatures#btPolyhedralConvexShape##UAE_NXZ)
1>C:\Libraries and Headers\Bullet\bullet-2.78\msvc\BulletTestApp\Release\BulletTestApp.exe : fatal error LNK1120: 14 unresolved externals
I know there's a link problem somewhere but i followed the instructions exactly so i don't know how to fix it. I don't see any additional dependencies when looking at the properties of the added projects if that's not how it's supposed to be... but I guess i don't understand this method of using a library in the first place though so that knowledge would help.
Alright, so apparently right clicking my TestBulletApp project and clicking 'Project Dependencies' was where i went wrong. msVS++ 2010 left the option there for some reason even though it
doesn't work to do it that way.
Instead to make the project dependent on the other projects in the solution you have to right click on your project like my "TestBulletApp" and go to Properties->Common Properties->Framework and References->Add New Reference" and add the depended on static library projects already added to the sollution such as 'bulletCollision' or whatever; also check that "Link Library Dependencies" is True on the right hand side.
So yeah thanks for the heads up guys..... 'cough' 'cough' =)

Linking to V8 does not work in release mode

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