News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

When to use 'project', release of debug build settings (ALSO about libraries)

Started by al_1, January 01, 2014, 04:29:54 PM

Previous topic - Next topic

al_1

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?

MortenMacFly

Quote from: al_1 on January 01, 2014, 04:29:54 PM
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).

Quote from: al_1 on January 01, 2014, 04:29:54 PM
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!

Quote from: al_1 on January 01, 2014, 04:29:54 PM
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.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]