www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ide - CodeBlocks

reply David Ferenczi <raggae ferenczi.net> writes:
I have managed to get CodeBlocks 8.02 work with dmd-2.012 under linux. It
wasn't obviouos (at least for me), so if someone is interested, I could
make a short howto.
Jun 24 2008
next sibling parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
David Ferenczi wrote:
 I have managed to get CodeBlocks 8.02 work with dmd-2.012 under linux. It
 wasn't obviouos (at least for me), so if someone is interested, I could
 make a short howto.
Please do, and put it on http://wiki.codeblocks.org as well ? If there are changes to Code::Blocks needed, please file a bug --anders
Jun 24 2008
parent reply David Ferenczi <raggae ferenczi.net> writes:
Here is the first draft. It would be nice if somebody would try it out, to
have some feedback.

1. Go to "Settings" -> "Compiler and debugger..."
2. In the dialog choose "Global compiler settings"
3. Select the compiler "Digital Mars D Compiler"
4. Go to "Linker settings" tab
5. Optional: change "phobos" to "phobos2" in the "Link libraries" if you use
dmd-2.xx
6.
Add "-g -m32 -Xlinker /opt/dmd/lib/libphobos2.a -Xlinker -L/opt/dmd/bin/../lib"
to the "Other linker options"
7. Go to "Search directorries" tab and choose "Linker" tab
8. Set your search directories. (For Gentoo: "/opt/dmd/lib" and "/usr/lib"
must be set.)
9. Go to "Toolchain executables" tab
10. Set the correct path for your dmd installation. (For Gentoo "/opt" must
be set.)
11. In the "Program Files" tab set the following values:
"C compiler" -> "dmd"
"C++ compiler" -> "dmd"
"Linker for dynamic libs" -> "gcc"
"Linker for static libs" -> "gcc"
"Debugger" -> "gdb"
"Resource compiler" -> "" (optional)
"Make program" -> "make"
12. In the "Additional Paths" tab add the installation path of the GNU
toolchain (gcc, make, gdb). (For Gentoo "/usr" must be set.)
13. Go to "Other settings" tab
14. Choose "Advanced options..."
15. On the "Commands" tab select "Compile single file to object file" from
teh combo box. Be sure that the "command line macro" is set to "$compiler
$options $includes -c $file -of$object". Mind the -of switch for $object!

These are the basic compiler settings, to make the compiler work.
Additionally you can set any compiler switches as you like, or define
resource compiler, or additional include paths for libraries and soruces,
etc. But normally these settings are project specific, therefore they
should go to the "Project -> Properties..".

+1:
I encountered an interesting issue in the project settings, which I could
only solve with a small workaround. If I set the "Output filename" in
the "Project -> Properties..." dialog box on the "Build targets" tab
to "<outputfilename>", the generated output file will be
named "f<outputfilename>". So I put the "mv f<outputfilename>
<outputfilename>" line in the "Project -> Build options..." dialog box on
the "Pre/post build steps" tab to the "Post build steps".

Any comments are welcome!

David
Jun 25 2008
next sibling parent reply =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se> writes:
David Ferenczi wrote:
 I encountered an interesting issue in the project settings, which I could
 only solve with a small workaround. If I set the "Output filename" in
 the "Project -> Properties..." dialog box on the "Build targets" tab
 to "<outputfilename>", the generated output file will be
 named "f<outputfilename>". So I put the "mv f<outputfilename>
 <outputfilename>" line in the "Project -> Build options..." dialog box on
 the "Pre/post build steps" tab to the "Post build steps".
I think this is due to the mixing of DMD and GCC when compiling/linking, i.e. if one passes -of<outputfilename> to gcc, that will be the result. --anders
Jun 25 2008
parent David Ferenczi <raggae ferenczi.net> writes:
Anders F Björklund wrote:

 David Ferenczi wrote:
 I encountered an interesting issue in the project settings, which I could
 only solve with a small workaround. If I set the "Output filename" in
 the "Project -> Properties..." dialog box on the "Build targets" tab
 to "<outputfilename>", the generated output file will be
 named "f<outputfilename>". So I put the "mv f<outputfilename>
 <outputfilename>" line in the "Project -> Build options..." dialog box on
 the "Pre/post build steps" tab to the "Post build steps".
I think this is due to the mixing of DMD and GCC when compiling/linking, i.e. if one passes -of<outputfilename> to gcc, that will be the result. --anders
Yes, it may be the problem, but I'm not sure if it can be really influenced by the configuration. The linking command looks like: $linker $libdirs -o $exe_output $link_objects $link_resobjects $link_options $libs CodeBlocks separates compiling and linking, and in my configuration gcc is called directly for linking with the -o switch. DMD is only used when making the individual object files, where the -of switch is used. David
Jun 25 2008
prev sibling next sibling parent reply =?ISO-8859-1?Q?S=F6nke_Ludwig?= writes:
 15. On the "Commands" tab select "Compile single file to object file" from
 teh combo box. Be sure that the "command line macro" is set to "$compiler
 $options $includes -c $file -of$object". Mind the -of switch for $object!
 
As a small note, I'd recommend to use "-od$objects_output_dir" instead of "-of$object". That way, the -op switch for dmd will also work.
Jun 26 2008
parent reply David Ferenczi <raggae ferenczi.net> writes:
Sönke Ludwig wrote:

 15. On the "Commands" tab select "Compile single file to object file"
 from teh combo box. Be sure that the "command line macro" is set to
 "$compiler $options $includes -c $file -of$object". Mind the -of switch
 for $object!
 
As a small note, I'd recommend to use "-od$objects_output_dir" instead of "-of$object". That way, the -op switch for dmd will also work.
If you use -od$objects_output_dir", but don't use the -op switch, the linker won't find the object files. (At least in my configuration.)
Jun 26 2008
parent =?ISO-8859-2?Q?S=F6nke_Ludwig?= writes:
David Ferenczi schrieb:
 Sönke Ludwig wrote:
 
 15. On the "Commands" tab select "Compile single file to object file"
 from teh combo box. Be sure that the "command line macro" is set to
 "$compiler $options $includes -c $file -of$object". Mind the -of switch
 for $object!
As a small note, I'd recommend to use "-od$objects_output_dir" instead of "-of$object". That way, the -op switch for dmd will also work.
If you use -od$objects_output_dir", but don't use the -op switch, the linker won't find the object files. (At least in my configuration.)
I see - CodeBlocks seems to assume -op in case of -od... unfortunate that -od/-op is not the default behaviour, since it's not that uncommon to have multiple modules with the same name.
Jun 26 2008
prev sibling parent reply Christian <cr blhg.org> writes:
followed your instructions with my osx installation of CodeBlocks 8.02.
But i always get the message:

-------------- Build: Release in dmd2Test ---------------

Compiling: Untitled1.d
/bin/sh: dmd: command not found


Is it possible to help me?
Jul 16 2009
parent David Ferenczi <raggae ferenczi.net> writes:
Christian wrote:

 followed your instructions with my osx installation of CodeBlocks 8.02.
 But i always get the message:
 
 -------------- Build: Release in dmd2Test ---------------
 
 Compiling: Untitled1.d
 /bin/sh: dmd: command not found
 
 
 Is it possible to help me?
I've answered you in private mail.
Jul 16 2009
prev sibling next sibling parent reply =?ISO-8859-1?Q?Tomasz_Sowi=f1ski?= <tomeksowi gmail.com> writes:
David Ferenczi Wrote:

 I have managed to get CodeBlocks 8.02 work with dmd-2.012 under linux. It
 wasn't obviouos (at least for me), so if someone is interested, I could
 make a short howto.
Someone has already done this: http://d.whosme.de/index.php?language=en&site=tutorials It's for windows, but I think most of it applies to both. And this German guy made many more video tutorials, which saved me from going out of my mind as a begginer. Tomek
Jul 20 2008
next sibling parent "Koroskin Denis" <2korden gmail.com> writes:
On Mon, 21 Jul 2008 01:05:11 +0400, Tomasz Sowiñski <tomeksowi gmail.com>  
wrote:

 David Ferenczi Wrote:

 I have managed to get CodeBlocks 8.02 work with dmd-2.012 under linux.  
 It
 wasn't obviouos (at least for me), so if someone is interested, I could
 make a short howto.
Someone has already done this: http://d.whosme.de/index.php?language=en&site=tutorials It's for windows, but I think most of it applies to both. And this German guy made many more video tutorials, which saved me from going out of my mind as a begginer. Tomek
Wow, it's awesome! A link to these tutorials should definitely be posted somewhere on digitalmars.com
Jul 20 2008
prev sibling parent David Ferenczi <raggae ferenczi.net> writes:
Tomasz Sowif1ski wrote:

 David Ferenczi Wrote:
 
 I have managed to get CodeBlocks 8.02 work with dmd-2.012 under linux. It
 wasn't obviouos (at least for me), so if someone is interested, I could
 make a short howto.
Someone has already done this: http://d.whosme.de/index.php?language=en&site=tutorials It's for windows, but I think most of it applies to both. And this German guy made many more video tutorials, which saved me from going out of my mind as a begginer. Tomek
Yes, it's a great tutorial, but if you read through my howto, you will find crucial points not discussed in the above video.
Jul 21 2008
prev sibling next sibling parent reply Dejan Lekic <dejan.lekic tiscali.co.uk> writes:
AFAIK C::B automatically detects DMD and GDC, and it works out of box...
Sep 09 2008
parent "Denis Koroskin" <2korden gmail.com> writes:
On Wed, 10 Sep 2008 03:22:15 +0400, Dejan Lekic  
<dejan.lekic tiscali.co.uk> wrote:

 AFAIK C::B automatically detects DMD and GDC, and it works out of box...
... on Windows.
Sep 10 2008
prev sibling parent reply Joel Christensen <joelcnz gmail.com> writes:
David Ferenczi wrote:
 I have managed to get CodeBlocks 8.02 work with dmd-2.012 under linux. It
 wasn't obviouos (at least for me), so if someone is interested, I could
 make a short howto.
I've tried two different step by step approches(sp) and still no go, I don't even get highlighted text.
May 04 2009
parent reply David Ferenczi <raggae ferenczi.net> writes:
Joel Christensen wrote:

 David Ferenczi wrote:
 I have managed to get CodeBlocks 8.02 work with dmd-2.012 under linux. It
 wasn't obviouos (at least for me), so if someone is interested, I could
 make a short howto.
I've tried two different step by step approches(sp) and still no go, I don't even get highlighted text.
Which one have you tried?
May 04 2009
parent reply Joel Christensen <joelcnz gmail.com> writes:
David Ferenczi wrote:
 Joel Christensen wrote:
 
 David Ferenczi wrote:
 I have managed to get CodeBlocks 8.02 work with dmd-2.012 under linux. It
 wasn't obviouos (at least for me), so if someone is interested, I could
 make a short howto.
I've tried two different step by step approches(sp) and still no go, I don't even get highlighted text.
Which one have you tried?
Which one? I've tried the video one: http://d.whosme.de/index.php?language=en&site=tutorials and your one. I'm using Microsoft Vista.
May 08 2009
parent reply David Ferenczi <raggae ferenczi.net> writes:
Joel Christensen wrote:

 David Ferenczi wrote:
 Joel Christensen wrote:
 
 David Ferenczi wrote:
 I have managed to get CodeBlocks 8.02 work with dmd-2.012 under linux.
 It wasn't obviouos (at least for me), so if someone is interested, I
 could make a short howto.
I've tried two different step by step approches(sp) and still no go, I don't even get highlighted text.
Which one have you tried?
Which one? I've tried the video one: http://d.whosme.de/index.php?language=en&site=tutorials and your one. I'm using Microsoft Vista.
I wrote my howto for Linux. It is based on dmd and the GNU tools, considering a unix-like file system hierarchy. I don't know much about Vista, but if you give an exact description of your problem (and how can it be reproduced), it is quite likely that you will get help.
May 09 2009
parent Joel Christensen <joelcnz gmail.com> writes:
David Ferenczi wrote:
 Joel Christensen wrote:
 
 David Ferenczi wrote:
 Joel Christensen wrote:

 David Ferenczi wrote:
 I have managed to get CodeBlocks 8.02 work with dmd-2.012 under linux.
 It wasn't obviouos (at least for me), so if someone is interested, I
 could make a short howto.
I've tried two different step by step approches(sp) and still no go, I don't even get highlighted text.
Which one have you tried?
Which one? I've tried the video one: http://d.whosme.de/index.php?language=en&site=tutorials and your one. I'm using Microsoft Vista.
I wrote my howto for Linux. It is based on dmd and the GNU tools, considering a unix-like file system hierarchy. I don't know much about Vista, but if you give an exact description of your problem (and how can it be reproduced), it is quite likely that you will get help.
Should be the same as XP. I don't know about discribing my problem. I think I'll look at it again if there's a howto for Windows. Thanks for trying to help. :-)
May 31 2009