News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

why doesn't dynamic library template exist?

Started by ensamblador, December 27, 2006, 04:02:31 PM

Previous topic - Next topic

ensamblador

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

MortenMacFly

Quote from: ensamblador on December 27, 2006, 04:02:31 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.
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]

Game_Ender

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.

ensamblador

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 ;)

Biplab

#4
Quote from: ensamblador on December 29, 2006, 12:39:28 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.
target.SetTargetType(ttStaticLib);

Now change it to -
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.
Be a part of the solution, not a part of the problem.

MortenMacFly

Quote from: Biplab on December 29, 2006, 01:45:20 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.
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]

ensamblador

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. ;)

Game_Ender

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.