Thread overview
Code::Blocks for D
Nov 03, 2005
Venix
Nov 03, 2005
Walter Bright
Nov 04, 2005
Venix
November 03, 2005
I took some time out of my day to get Code::Blocks to support D.
For those of you unfamilar with it heres a link http://codeblocks.org/.

Code::Blocks
The open source, cross platform Free C++ IDE.

Newest version: 1.0rc2, Oct 25, 2005

Code::Blocks is a free C++ IDE built specifically to meet the most demanding needs of its users. It was designed, right from the start, to be extensible and configurable.

Heres a link to get ya started with it. http://www.prowiki.org/wiki4d/wiki.cgi?EditorSupport#CodeBlocks

Playing with DMD I ran into a couple personal issues. First was the linker. Don't know why I can't specify Def arguments on the commandline to create a DLL. So I made a utility called dlink(D Linker). It just wraps gcc syntax into something compatible with link & lib.  It also outputs a .def file for me and you.  But it's required to use the codeblocks IDE. Has a link at the above Wiki page.

I've included the source. It's a simple program. Not documented and bloated.

I've tested static libraries, DLLs & Console programs and they all more or less
work. They were simple examples but worked quit well.
Codeblocks runs on linux. But I haven't tested my changes, nor will I in the
near future.  Dlink would need to be ported. A simple shell script that passes
arguments to gcc for linking or ar & ranlib for static libraries.

Since it's a related subject and I have your attention.  I wanna take a look at DLL support.  During my testing, I had several issues using them.  The first was that even tho class functions could be exported to a dll. Namely the constructor and static functions.  The class wasn't. This prevented me from using it.  I had to create a static class function called create which just created an instance and returned it. It's easy enough and I got no problem with it. But it adds to maintence. If I add a new constructor I gotta add a new create function. Shouldn't Class Names be exported too?

The second is I'd like to have the ability for dlink to supply the dll glue code(DllMain) that wraps the gc's together as mentioned on the site.  Without it I got access Violations. But I saw no sort of copyright notice on the sample mydll/dll.d file. And I wanted to include that. But it'd have to be usable for any purpose. So clarification on that issue would be nice.

Well that's all I have.


November 03, 2005
"Venix" <Venix_member@pathlink.com> wrote in message news:dkbp68$vgg$1@digitaldaemon.com...
> The second is I'd like to have the ability for dlink to supply the dll
glue
> code(DllMain) that wraps the gc's together as mentioned on the site.
Without it
> I got access Violations. But I saw no sort of copyright notice on the
sample
> mydll/dll.d file. And I wanted to include that. But it'd have to be usable
for
> any purpose. So clarification on that issue would be nice.

I'll put a note on it that it's public domain.


November 04, 2005
Walter Bright wrote:
> "Venix" <Venix_member@pathlink.com> wrote in message
> news:dkbp68$vgg$1@digitaldaemon.com...
> 
>>The second is I'd like to have the ability for dlink to supply the dll
> 
> glue
> 
>>code(DllMain) that wraps the gc's together as mentioned on the site.
> 
> Without it
> 
>>I got access Violations. But I saw no sort of copyright notice on the
> 
> sample
> 
>>mydll/dll.d file. And I wanted to include that. But it'd have to be usable
> 
> for
> 
>>any purpose. So clarification on that issue would be nice.
> 
> 
> I'll put a note on it that it's public domain.
> 
> 
With that said, I've updated the dlink utility. It does more things, I may have broke some things. BUt most notably are.

--encode <file> : Encodes a file into base64. -o specifies output
--decode <file> : Decodes a file from base64. -o specifies output
--quoted : Used with encode & dumps the file to something usable by the preprocessor. To allow it to be dumped by a program.
char file_data =
#include <file_data.base64>
;
--source : Dumps dlink source,projects files & dll source. -o specifies output.
--dll : Links the supplied dll object with the rest of the input.

Note tha its the unmodified "DLLs with a C Interface" code also found in  samples/d/mydll/ as dll.d.  It aint much. But it prevents an access violation with dll linking.  I'd like to get it to do all that gc trickry w/o the user doing anything. So if ya wanna do something about that. It would be appreciated.