Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: fmollica on March 06, 2013, 04:41:28 pm

Title: How to compile in a DLL from C::B ?
Post by: fmollica on March 06, 2013, 04:41:28 pm
Hi,

I am very new to C/C++, I went through several tutorials, so I know some basics. I have to create a .dll library to add new functionality to an already existing code.  Coding the functions in C++ shouldn't be hard, it's basically mathematical operation (algebra, integration and so on). But I feel like I misunderstand something very elementary, that elementary that I cannot find any pre-existing topic about it :

Considering I know the particular syntax required to write a DLL how I can compile it from C::B ? At the project creation, there is no "Dynamic Library L..." choice, as I have seen on some tutorials, why ? Do I have to set some option on gcc ? (I use gcc on debian). All the tutorials about DLL are very advanced, and look like using particular Windows stuff, I don't get it.

Thanks,

Flo
Title: Re: How to compile in a DLL from C::B ?
Post by: Jenna on March 06, 2013, 04:51:33 pm
That shows, that you either read the wrong tutorials or did not understand them.
There are no files called *.dll on linux, but so called shared object files (*.so).

As template you can use the "Shared library"-wizard.
Title: Re: How to compile in a DLL from C::B ?
Post by: cacb on March 06, 2013, 06:39:32 pm
I used to have similar questions, after making DLLs on Windows and wanting to create Shared Object libraries (*.so) under Linux. I struggled to find information.... but now I currently do that regularly using Code::Blocks with MSVC compiler on Windows and gcc compiler on Linux, i.e. one project but multiple build targets.

The main difference between the two is that for DLLs made with MSVC you must export functions and classes "the MS way", but under gcc all classes and functions are exported by default. Therefore, creating *.so libraries under linux is so easy that few bothered to write a tutorial, it is similar to creating a static library but using the "Shared Library" project template instead of the "Static Library" project template in C::B.
Title: Re: How to compile in a DLL from C::B ?
Post by: fmollica on March 08, 2013, 09:38:07 am
Thank you very much for your responses ! Now I understand better what I have to look for.