Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: al_1 on January 01, 2014, 04:29:54 pm

Title: When to use 'project', release of debug build settings (ALSO about libraries)
Post by: al_1 on January 01, 2014, 04:29:54 pm
Hello, just to say that when signing up the year should be 2014 not 2013 :D

Why would you use 'project settings' vs individual release or debug, I suppose it's just to have control over all three, I have realized I have just answered my most obvious of questions, doh. Well will post anyway.

EDIT: Will add this questions also, thanks for any advice. This is a more general C++ questions though.

IN C::B's you can create a (SL)static lib(lib*.*a), (DLL)dynamic link lib(*.dll, *.def, *.a) and a (ShL)shared lib(lib*.*dll, lib*.*.def, lib*.*.a).
Also an import library (*.lib)

Firstly I thought *.a was a Linux file extension.
I have created DLL *.dll before and used via LoadLibrary(), what are the *.def and *.a for they aren't distrubted in any DLL i have seen before?
I understand that DLL's are loaded at runtime.
So what is the different between the shared and static and dynamic and which files do you need for each i..e def, a dll?
Title: Re: When to use 'project', release of debug build settings (ALSO about libraries)
Post by: MortenMacFly on January 03, 2014, 08:43:09 am
Firstly I thought *.a was a Linux file extension.
Nope, not true. Basically you could even choose any extension as long as the linker supports it. For example, MinGW can easily handle *.lib as well as *.a as well as *.dll (yes -  link against a DLL).

I have created DLL *.dll before and used via LoadLibrary(), what are the *.def and *.a for they aren't distrubted in any DLL i have seen before?
*.def contains the exported symbols (definitions) and maybe of help for debugging or distribution - its not needed at runtime. *.a is required in certain circumstances to link against this as an import library for the DLL. Its not needed at runtime. Remember: Its an import library for a DLL, not a static library!

So what is the different between the shared and static and dynamic and which files do you need for each i..e def, a dll?
Static libraries in general are "link and you are fine" - they do usually not need any further dynamic runtime libraries (as long as the static libs does not have references to such in itself). Dynamic libs are the opposite: You need them at runtime, just like *.dll or *.so or *.dylib files (Windows / Unix-Linux / MacOS).

I hope that helps, but for further reference, please read a book about basic compiler functionalities. This forum does not answer programming or compiler related questions in general. This forum is dedicated to Code::Blocks and does not teach basics skills. I am locking this topic now therefore.