LNK 2001 Error in Visual Studio 6 - c++

I've been thrown a bit in the deep-end with a C++ app I need to get running and I cant get it to build.
It appears that just about error source file throws out this error:
BindActivView.obj : error LNK2001 : unresolved external symbol "public: void __thiscall CNOLEError::AddError(struct IUnknown *,struct _GUID const &:" (?AddError#CNOLEError##QAEXPAUIUnknown##ABU_GUID###Z)
Could someone please point me in the right direction with how I go about fixing this?

You omit some obj/lib file in your project.
You probably use some lib files which need to be linked together with your output.

Related

link error 2001 when compiling maya plugin example

I'm trying to compile the maya example plugin manipOverride from the devkit, but got several link errors below:
error LNK2001: unsolved external reference "public: virtual class MStatus __cdecl MPxNode::dependsOn(class MPlug const &,class MPlug const &,bool &)const " (?dependsOn#MPxNode##UEBA?AVMStatus##AEBVMPlug##0AEA_N#Z) D:\Program Files (x86)\MAYA\2016\devkit\devkitBase\devkit\plug-ins\manipOverride\manipOverride.obj manipOverride
error LNK2001: unsolved external reference "public: virtual class MStatus __cdecl MPxContext::doPtrMoved(class MEvent &)" (?doPtrMoved#MPxContext##UEAA?AVMStatus##AEAVMEvent###Z) D:\Program Files (x86)\MAYA\2016\devkit\devkitBase\devkit\plug-ins\manipOverride\manipOverride.obj manipOverride
Maya2016, vs2012&vs2013. vs2012 is recommended by the official doc but still got the same errors.
I've checked the linker setting, OpenMaya.lib, OpenMayaUI.lib is included in the input libs. There're no similar problems found, anyone can help?
Its looks like you are trying to compile a plugin which has setting for 32 bit and now you compiling with x64. Probably you need to change the Solution Platform from you Configuration Manager.

Error while building an application using protobuf on VS2013

I'm new to protobuf. I did the tutorials proposed by Google and everything was fine. I'm now trying to make my own application working and I get an error that I don't understand.
Error 1 error LNK2019: unresolved external symbol __imp__close referenced in function "public: bool __thiscall google::protobuf::io::FileInputStream::CopyingFileInputStream::Close(void)" (?Close#CopyingFileInputStream#FileInputStream#io#protobuf#google##QAE_NXZ) D:\Projets\bin\pb_decoder\libprotobuf.lib(zero_copy_stream_impl.obj) pb_decoder_pck
Error 2 error LNK2019: unresolved external symbol __imp__read referenced in function "public: virtual int __thiscall google::protobuf::io::FileInputStream::CopyingFileInputStream::Read(void *,int)" (?Read#CopyingFileInputStream#FileInputStream#io#protobuf#google##UAEHPAXH#Z) D:\Projets\bin\pb_decoder\libprotobuf.lib(zero_copy_stream_impl.obj) pb_decoder_pck
Error 3 error LNK2019: unresolved external symbol __imp__write referenced in function "public: virtual bool __thiscall google::protobuf::io::FileOutputStream::CopyingFileOutputStream::Write(void const *,int)" (?Write#CopyingFileOutputStream#FileOutputStream#io#protobuf#google##UAE_NPBXH#Z) D:\Projets\bin\pb_decoder\libprotobuf.lib(zero_copy_stream_impl.obj) pb_decoder_pck
I didn't use protobuf in my code for now. The only thing I wrote is
#include "helloworld.pb.h"
and my helloword.proto looks like that :
syntax = "proto3";
message Hello {
int32 id = 1;
string name = 2;
}
Any idea about the problem here ?
unresolved symbols sounds like a missing like error to me but the libs are actually here.
I found a post on groups.google which was pointing out a problem quite similar to my own issue, but it didn't work for me.
Problem with linking runtime libraries on Windows for C++
Context
protobuf version 3.0
IDE : Visual Studio 2013
My application is a RTMAPS diagram (sofware quite similar to simulink), in case someone heard about this :)
Thanks guys for your help !
EDIT :answer is in the question :)
The link I gave in my question is actually the answer to my question. I just didn't correct the files correctly.
It is however strange that I'm the only one getting this error on the last version of protobuf (3.0).
Here is the link once again :
Problem with linking runtime libraries on Windows for C++
I hope it will be helpful to someone !

error LNK2019: unresolved external symbol _Direct3DCreate9Ex#8 referenced in function "protected: XYX()"

I am getting the following LINK error while compiling my C++ solution:
error LNK2019: unresolved external symbol _Direct3DCreate9Ex#8
referenced in function "protected: XYX()
The symbol "Direct3DCreate9Ex' is defined in "ddraw.h" header file found in "C:\Program Files\Microsoft SDKs\Windows\v7.0\Include". And verified that the header file "ddraw.h" is present in this location. Also I have included this path in VS settings "Tools-->Options-->VC++ Directories -> Includes".
But still I am getting the link error as "error LNK2019: unresolved external symbol _Direct3DCreate9Ex#8 referenced in function "protected: XYX()" ".
Can anyone kindly help me in getting rid of this link error while compiling my C++ solution.
I am using VS 2008 on 64 bit Win7.
Thanks in advance.
Based on reference page for Direct3DCreate9Ex you need to link with D3D9.lib.

Error LNK 2019 unresolved external symbol from header file from my professor

So I'm pretty new to C++ programming and am taking a class on it but am having some trouble with an assignment because I am getting an error I can't seem to fix. The assignment is to create a composite class out of a number of classes using a string class the professor gave us. The problem I'm having is that I'm getting an unresolved external symbol error from the header file he gave us and I don't know why. I added the folder containing the header file and the associated cpp file using Properties -> C/C++ -> General -> Additional Include Directories and then used #include in the header file for my class but I'm getting 2 errors when I try to build it, the program compiles just fine. It's strange that I'm only getting 2 errors when there are many more functions in WCS_String that don't return an error.
Here are the error codes I'm getting:
1>Name.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall WCS_String::~WCS_String(void)" (??1WCS_String##UAE#XZ) referenced in function __unwindfunclet$??0Name##QAE#XZ$0
1>Name.obj : error LNK2019: unresolved external symbol "private: void __thiscall WCS_String::LocalCopy(char const *)" (?LocalCopy#WCS_String##AAEXPBD#Z) referenced in function "public: __thiscall WCS_String::WCS_String(char const *)" (??0WCS_String##QAE#PBD#Z)
If anyone could help me it would be greatly appreciated as I have run into a dead end with my limited programming knowledge. If you need any more information in order to help me please just ask.
If I were you I would just copy all the professor files to the project directory, and add both header and source files to it.
If you have .o or .obj files associated with your WCS_String class, you need to tell your linker where to find them.

cannot open file 'LIBC.lib'

I changed a workspace developed in VC 6.0 to VS 2008. When I tried to build the workspace I am getting the following error message. How can I correct the problem?
fatal error LNK1104: cannot open file 'LIBC.lib'
I am getting the following messages when I ignored libc.lib
Error 1 error LNK2019: unresolved external symbol "__declspec(dllimport) class CIHoTSimEngine * __cdecl CreateHoTSimEngine(void)" (__imp_?CreateHoTSimEngine##YAPAVCIHoTSimEngine##XZ) referenced in function "private: int __thiscall CHoTSimV2Doc::Init(void)" (?Init#CHoTSimV2Doc##AAEHXZ) HoTSimV2Doc.obj HoTSimV2
Error 2 error LNK2019: unresolved external symbol "__declspec(dllimport) class CIFABConnect * __cdecl CreateFabConnectServer(void)" (__imp_?CreateFabConnectServer##YAPAVCIFABConnect##XZ) referenced in function "private: int __thiscall CHoTSimV2Doc::Init(void)" (?Init#CHoTSimV2Doc##AAEHXZ) HoTSimV2Doc.obj HoTSimV2
Error 3 fatal error LNK1120: 2 unresolved externals D:\Projects\AsWorxSim\Bin\Release\HoTSim2.0.exe 1 HoTSimV2
Project Property -> Configuation Properties -> Linker -> Input -> Ignore Specific Library
Ignore the LIBC.LIB
Edit: I think once you remove the LIBC.lib as mentioned above, you are moving ahead with your linking and getting errors which exist in your app. You should try to look in these errors now. Think about it, if libc.lib was missing in the first place then how could it provide any linkage which seems to have appeared after you ignored it.
Command line option:
cl source.cpp /link /NODEFAULTLIB:LIBC.LIB
look here:
Discussion about libc on microsoft forum that's for vs2005 but for 2008 it is the same...
You need to "Rebuild All", to make sure you don't have any .obj files from VC6 hanging around.