Hellish

hello,

when i try to compile (build) a project it gives me this error:

Instance_ShadowfangKeep.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl HandleShutdown(class Socket *,unsigned long)" (__imp_ HandleShutdown@@YAXPAVSocket@@K@Z)

it gives me 32 errors so a other error is like:

Instance_moltencore.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl HandleShutdown(class Socket *,unsigned long)" (__imp_ HandleShutdown@@YAXPAVSocket@@K@Z)

for example.

any ideas

thanks




Re: Visual C++ General Help please!

Hellish

hmm it seems to be a .lib (library) error

here is my build log:

http://filebeam.com/34211fea2b1d600d69398e9a8e21a8ec






Re: Visual C++ General Help please!

Nishant Sivakumar

Since you have identified it as a lib error, why don't you try and locate what lib it is that you need And then you can include that lib in the linker modules.




Re: Visual C++ General Help please!

Hellish

Hmm wel im a c++ beginner im a n00b in c++ so how do i locate the .lib i need a lib called antrix.lib and i already have that.




Re: Visual C++ General Help please!

Hellish

ok i found out its not a .lib error its a .obj error.

[code]

Raid_OnyxiasLair.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __fastcall Object:Tongue TiedendMessageToSet(class WorldPacket *,bool,bool)" (__imp_ SendMessageToSet@Object@@QAIXPAVWorldPacket@@_N1@Z)

[/code]





Re: Visual C++ General Help please!

Hellish

Soooo any solutions




Re: Visual C++ General Help please!

crescens2k

This is a lib error. Basically you are not linking the import library which contains the correct function to your project. If you have the lib then go to Project->Properties->Configuration Properties->Linker->Input and add it to additional dependencies.




Re: Visual C++ General Help please!

Hellish

that doesn't help i already got the .lib in there Tongue Tied.




Re: Visual C++ General Help please!

crescens2k

Well, it means that the lib you have in there doesn't contain the function you want. You should look in the documentation of what you are using to figure out what libraries you need to link.

Also, giving more information on what you are trying to do will help greatly.






Re: Visual C++ General Help please!

Hellish

well im trying to compile a project with .cpp and .h files to a .dll so it uses the antrix.lib

but it says error at the lib but it works fine for others.






Re: Visual C++ General Help please!

Simple Samples

For errors such as that it usually helps to copy the messages to a workarea and insert line breaks, such as:


Instance_ShadowfangKeep.obj : error LNK2001: unresolved external symbol
__declspec(dllimport) void __cdecl HandleShutdown(class Socket *,unsigned long)
(__imp_ HandleShutdown@@YAXPAVSocket@@K@Z)

Instance_moltencore.obj : error LNK2001: unresolved external symbol
__declspec(dllimport) void __cdecl HandleShutdown(class Socket *,unsigned long)
(__imp_ HandleShutdown@@YAXPAVSocket@@K@Z)

Next it helps to delete extraneous text. So the useful portions are:


__declspec(dllimport) void __cdecl HandleShutdown(class Socket *,unsigned long)
__declspec(dllimport) void __cdecl HandleShutdown(class Socket *,unsigned long)

Those functions are not in an obj file; they are in a dll. You need to link using the lib file for the dll. So you need the lib file. The linker finds lib files usualluy using two options. You need to specify the lib file explicitly using the lib file name. You might be doing that. The linker though needs to be also told what directory that the lib file is in. In the options for the compiler, there is a list of directories that VC will always use. If the lib file is not in one of those directories, then you must specify the directory as an additional directory for the linker to use for the project.






Re: Visual C++ General Help please!

DianeS

I'm running into the same problem. I'm trying to move a 15-year old legacy C app over to Visual Studio. It makes fine running the old command line interface with makefiles. There are five .LIBs that are used to create a DLL. I made a master project with five sub projects, which are static libraries (.lib). When I build one, I get multiple

error LNK2001: unresolved external symbol
errors for functions that are defined in the other modules. I tried ordering the dependancies, but that didn't help. I don't see a Linker tab in the configuration properties section or Input specified in anywhere.






Re: Visual C++ General Help please!

crescens2k

For this, you must make sure that you have your dll project selected before you look at the properties otherwise you will get the properties for something else.





Re: Visual C++ General Help please!

crescens2k

OK, first of all, I figured you are trying to compile, but what, as I said, knowing what you are doing will help greatly.
Where did you get this antrix.lib from Is it static or is it an import library for a dynamic library What classes are you trying to use





Re: Visual C++ General Help please!

Hellish

Also not working =(

../../../bin/release/script_bin/InstanceScripts.dll : fatal error LNK1120: 2 unresolved externals

when i compile it it shut create instancescripts.dll but it gives error