Author Topic: How to compile in a DLL from C::B ?  (Read 13097 times)

Offline fmollica

  • Single posting newcomer
  • *
  • Posts: 2
How to compile in a DLL from C::B ?
« 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

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How to compile in a DLL from C::B ?
« Reply #1 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.

Offline cacb

  • Lives here!
  • ****
  • Posts: 536
Re: How to compile in a DLL from C::B ?
« Reply #2 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.

Offline fmollica

  • Single posting newcomer
  • *
  • Posts: 2
Re: How to compile in a DLL from C::B ?
« Reply #3 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.