Jump to content
  • Advertisement


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


Run-Time Library questions.

This topic is 5531 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''ve been reading Sobeit Void''s excellent article about making solid LIBs, writing LIBs plus an article on the subject... And suddenly I had an interesting question thrown at me by a work pal: There are six possible run-time libraries in C++, okay. Libraries and DLLs should use the same run-time library as the main project using them, okay. Question #1: Windows involves a whole shebang of DLLs, are they all available in those six versions? I don''t picture all programs using the correct name mangling to statically link to the right DLL. How is this issue addressed?!? Question #2: I''ve noticed VC++ 6.0 to automatically pick ''Multi-Threaded'' as its run-time library when making a DLL. I am working on a single-threaded program that uses a statically-linked DLL. Is it safe to use a DLL that''s single-threaded??? (It is built with the project, it''s not a system nor shared DLL) =^.^= Leaders and teachers should remember: It is best to offer others what they Need, not what they Want.

Share this post

Link to post
Share on other sites
Answer #1:
- DLLs aren''t ever statically linked.

- When you''re building an app or DLL which makes use of something in a DLL you statically link with an **export library** which is a .lib file that contains the full name of the DLL and mapping for any name mangling that may be required to access functions in that DLL.

Answer #2:
Yes, it''s safe. The main reason for matching the version of the CRT being used is because some structures such as those being used by the memory allocator have slightly different sizes and layouts between the different CRT versions.

Simon O''Connor
Creative Asylum Ltd

Share this post

Link to post
Share on other sites

So DLLs being rather encased means that a well-made single-threaded DLL might actually be called safely by a program that uses the multithreaded CRT. (Well-made = all memory allocations remain inside the DLL or inside the EXE, no sharing) Am I right?

I also remember that DLLs tend to use memory in a peculiar manner as compared to the calling EXE. Where might I find information about that, might I ask?

(I know MSDN would be a good guess, but it is so -massive- I don''t know where to look in MSDN. )

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!