Jump to content
  • Advertisement
Sign in to follow this  
PrincessDaisy

Dynamic Linking Libraries and including lib files

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

Everytime I use dll's on Windows machines, I included the lib file that goes along with the dll, just to make my life a bit easier. That way I dont have to call ::LoadLibrary etc. and all associated programs can still have the dll swapped. But can I do something similar on Linux machines? I know there is an .so file, which is the equivalent of the windows .dll, but is there also an associated library file that goes along with the .so file? I know that a .la file is created also, but I don't know about the .o file. Any help would be appreciated Daisy

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by PrincessDaisy
Everytime I use dll's on Windows machines, I included the lib file that goes along with the dll, just to make my life a bit easier. That way I dont have to call ::LoadLibrary etc. and all associated programs can still have the dll swapped.

But can I do something similar on Linux machines? I know there is an .so file, which is the equivalent of the windows .dll, but is there also an associated library file that goes along with the .so file? I know that a .la file is created also, but I don't know about the .o file.

Any help would be appreciated
Daisy


I do the same thing under Windows for my project. It is not necessary for linux though. The g++ compiler can link using the information from the .so file directly (I don't even make a .la or .a file).

Tom

Share this post


Link to post
Share on other sites
Ok, that sounds good, but just to clarify (if you don't mind:) )

In my main dll, i declare a few external variables in the header file, and in windows land, I need to include the lib file, as they contain the actual variable definitions.

So in Linux land, it wont matter that the externals are declared in the so file, as linux will figure that out? Sound weird to me, but when it comes to Linux, what so i know..!

Daisy

Share this post


Link to post
Share on other sites
There is an equilavent of a .lib file for linux which is the .a file, as mentioned above you don't need to use a .a file when linking to the shared object under Linux.

Share this post


Link to post
Share on other sites
Quote:
Original post by PrincessDaisy
Ok, that sounds good, but just to clarify (if you don't mind:) )

In my main dll, i declare a few external variables in the header file, and in windows land, I need to include the lib file, as they contain the actual variable definitions.

So in Linux land, it wont matter that the externals are declared in the so file, as linux will figure that out? Sound weird to me, but when it comes to Linux, what so i know..!


Yes, on linux all you need is in the .so. My library has plenty of externals and works quite well on linux.

To me the weird thing is that it doesn't work like this on windows :) I see no reason why windows can't put all the info required for linking to a dll in the dll itself.

Tom

Share this post


Link to post
Share on other sites
Excellent, thanks for the info. Thats made my life a lot easier, I was thinking I would have to alter a lot of my project to get it working on Linux.

Again, thanks
Daisy

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!