Jump to content
  • Advertisement

Archived

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

monkeyman

Why can't I link another static lib to my static lib project?

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

Hey- I''m creating a very basic static library using VC++, but the link option is GONE for static libraries.. How can I link to a library when there is no option?..I tried the #import directive, but it simply states error loading type library/dll.. I can''t find any mention of why the link tab is not in the project options for static libraries, and all of the documentation I''ve seen: *Assumes you''re building a DLL. OR *Gives step-by-step instructions for finding the link tab. Am I insane?..is it simply NOT possible to link a static library to a static library?, or is MS just giving me a few extra hours of work and not bothering to document why? I''ve built static lib''s and dll''s before, I never would have imagine I would have so much trouble adding a simple static library to one of them(which happens anyway with the default runtime libraries).. GRRRRRR!!!!!! "Like all good things, it starts with a monkey.."

Share this post


Link to post
Share on other sites
Advertisement
No, you can''t, because a static lib is not used that way...

All a .LIB is doing is writing out a file with the machine language instructions for the current set of functions. It does NOT link (or include) in it''s own dependencies. Because a .LIB ONLY has to do with the current source...

Don''t blame MS, this has nothing to do with them. This is the way C was designed so long ago...

What you need to do is include both static .LIB to the project that is using the first .LIB...

---

However, you can do what you are looking for with a .DLL project (it has a linker tab) because Microsoft says so, and they are the ones who made .DLL... =)

Share this post


Link to post
Share on other sites
Ooh, I was afraid of that..

I know that statically linked lib''s are just machine code, but I thought surely there must be some way of combining the instructions from multiple static libs into one..

If only I had the code for the other libs I could do combine them manually within the project, but I don''t have the sources

btw I have done this before with a dll using VC++, so I thought it was a valid option for the static libs..

Thanks for the info though, at least now I know what''s up..

"Like all good things, it starts with a monkey.."

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!