Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Yohomyth

C++ implicit link problem

This topic is 5278 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
kernel32.lib is used by default.



-----------------------------------------------
Here comes the Thnikkaman!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!