Jump to content
  • Advertisement
Sign in to follow this  
TheNobleOne

Static linked Library Troubles

This topic is 4844 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

I am having some trouble with my graphics engine. I chose to do static linked libraries because I don't know how to do dll's in C++. But I am having some trouble anyway. First off i am using Dev-C++ to do this. I have VC++ but I have no clue why I don't use it probably because it is very out of date. Well anyway I want to test my engine outside of my coding test environment. So I decided to try a static linked library. My engine is using SDL for windowing as this might have something to do with it. Step 1. I created a static linked lib project and put in my header file and my cpp file. Step 2. Next I linked the SDL libraries SDLmain and SDL. Step 3. I compiled my library. Now I went to another project and coded up a test app that I know works becuase I tried it in my development setup before hand. Step 4. I linked the sdl libraries to my app because I need them for event handling. Step 5. I linked opengl and glu because I am using them for rendering Step 6. I linked my static library Took me a while just to get it to find my library turns out I had to use the Dev-C++ browser to pic the lib file. Now when I compile it gives a list of linker errors saying it can't find the functions that are defined in SDL. Not the ones for the event loop but the ones my engine is using for windowing. What is going on here? Everything should work fine according to my steps did I do something wrong?

Share this post


Link to post
Share on other sites
Advertisement
If you are using static libraries you don't need to link to any external libraries since the end file is simply an archive of the intermediate object files, the linker is never run on them. You will need to link to any libraries used within the static library in the client application, so in your case you only link to the SDL libraries in your test application, not the engine library.

Share this post


Link to post
Share on other sites
Ok thanks for clearing that up. I decided not to use C++ tho I am going to learn MDX and use C# because I am better in C# anyway. But that is nice to know if the time arises again.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!