Skip to main content
gamedev.net
🔒 Locked

C++ implicit link problem

Started by Yohomyth Jun 6, 2004 at 2:07 AM 1 replies 500+ views
Original Post
Yohomyth
Yohomyth
In VC6 I''m trying to make a library that doesn''t require you to use any of the standard headers (like windows.h), but I need to implicitly link something to make it work. I dug deep into the headers and found something like this in WINBASE.H: (I''m not home now, so this is from memory) #define LoadLibrary LoadLibraryA DECLSPEC_IMPORT HMODULE CALLBACK LoadLibrary(LPCSTR szFileName); Without the macros it would be: __declspec(dllimport) unsigned short __stdcall LoadLibraryA(const char *szFileName); I put this exact code into my headers so I can load the DLLs, but I always get the ''unresolved external symbol'' linker error. I looked through my assembly includes and found that LoadLibraryA is from Kernel32.dll, so it should be just fine but it''s not! Does anyone know what I''m doing wrong? Any help is appreciated. ----------------------------------------------- Here comes the Thnikkaman!
------------------------------------------------------------"Many combilations elizagerth. I hope you see my particles." - Senor Cardgage
Monder
Monder
You''ve got the function definition but you still have to tell the linker where the libary that has the function in is, I believe the libary you have to link to for kernel32.dll is kerner32.lib.
Yohomyth
Yohomyth
kernel32.lib is used by default.



-----------------------------------------------
Here comes the Thnikkaman!
------------------------------------------------------------"Many combilations elizagerth. I hope you see my particles." - Senor Cardgage

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.