Code::Blocks Forums

User forums => Help => Topic started by: ensamblador on December 27, 2006, 04:02:31 pm

Title: why doesn't dynamic library template exist?
Post by: ensamblador on December 27, 2006, 04:02:31 pm
Hi

I have installed package CB_20061220_rev3407_Ubuntu6_10.deb in ubuntu edgy. When I want to start a new project there isn't any template to build dynamic libraries, only static libraries. Where dynamic libraries template is?  :?

Thanks
Title: Re: why doesn't dynamic library template exist?
Post by: MortenMacFly on December 28, 2006, 02:56:34 pm
Where dynamic libraries template is?  :?
Dynamic Link Libraries are currently Win32 only. (And in fact there are no DLL's under Linux.) The reason is simple: I hardly have access to a linux box to make it linux "compatible". In fact: There should be created an additional wizard for Linux as DLL's are fairly different to the shared libraries concept under linux (e.g. the example code wouldn't work at all).
So either you create a linux "SO" wizard based on the DLL wizard or you provide me with a minimal example code for such on linux and help me testing... ;-)
With regards, Morten.
Title: Re: why doesn't dynamic library template exist?
Post by: Game_Ender on December 29, 2006, 08:57:05 am
There is no need for a template because in Unix shared libraries are simpler to create than in windows.  Just create the static library template, and then change the executable type (The part that says, 'GUI Program', 'Console Program', etc) to 'Dynamic Library' then you are set.
Title: Re: why doesn't dynamic library template exist?
Post by: ensamblador on December 29, 2006, 12:39:28 pm
Excuse me Morten, I wanted to say shared libraries, not dynamic libraries  :oops:

Game_Ender, I don't understand what you are saying me, create a new static library template and then modify it? :S

Thanks ;)
Title: Re: why doesn't dynamic library template exist?
Post by: Biplab on December 29, 2006, 01:45:20 pm
Game_Ender, I don't understand what you are saying me, create a new static library template and then modify it? :S

He wants to say that open the file <Code::Blocks Dir>\share\CodeBlocks\templates\wizard\staticlib\wizard.script in Notepad++ (My favourite) or Notepad. Then goto line no 66.
Code
target.SetTargetType(ttStaticLib);

Now change it to -
Code
target.SetTargetType(ttDynamicLib);

That's it!

But I don't know whether the sample code will work or not.  :D

If that works then you can create a new wizard very easily by some Copy-Paste of few files and Adding few lines of code.
Title: Re: why doesn't dynamic library template exist?
Post by: MortenMacFly on December 29, 2006, 03:13:01 pm
If that works then you can create a new wizard very easily by some Copy-Paste of few files and Adding few lines of code.
That's exactly what I meant. Except that C::B surely supports to edit *.script files inside C::B itself. No need for another Editor... ;-)
With regards, Morten.
Title: Re: why doesn't dynamic library template exist?
Post by: ensamblador on December 29, 2006, 04:49:08 pm
Ok, anyway, if someone could create and exampled wizard and post here I would be very grateful.

Thanks for the aid, this is a great forum. ;)
Title: Re: why doesn't dynamic library template exist?
Post by: Game_Ender on December 29, 2006, 07:39:18 pm
I should of been more specific.   Just go into the target properties dialog and change the 'static library' to 'dynamic/shared library'.  No need to hack the scripts, but if want a whole new template instead of just a working project that will work as well.