PDA

View Full Version : Code::Blocks template



Doctor49152
04-08-2008, 05:52 PM
I created a generic lightwave plugin template for the CODE::BLOCKS IDE.
http://www.interocitor-media.com/LW-Codeblocks_template.zip

I switched to Code::Blocks from Bloodshed Dev-C++ and have been very happy with the program. I've also included complete setup instructions for those just getting started.

If I get time I might create templates for other types of plugins (shaders and such)

Let me know what you think and if I'm missing anything (or an error)

RedBull
04-09-2008, 03:22 AM
Thanks, yeah i recently did the same, DevC++ had been dead for many years (because it was written in Delphi) But I've waited 2+ years for a real release of CodeBlocks, and recently it actually happened WooHoo!

Thanks for the template.

evenflcw
04-09-2008, 05:23 AM
Thanks! I also use CodeBlocks. Usually just copy an old project to get going a new one.

Doctor49152
04-09-2008, 11:31 PM
Oops! I made a small error and didn't include the server.def file with the Template. I also included a few other files that I had taken out. Everything should be good to go now.

sorry

Doctor49152
04-11-2008, 01:47 AM
Also if you want you edit the lightwave.cdp file to add the path to your LW Plugins directory. So when you build your plugin it will be put there automatically.

Change the line:
<Option output="$(PROJECT_NAME).p" prefix_auto="0" extension_auto="0" />

to read:
<Option output="C:\Program Files (x86)\NewTek\LightWave 3D 9\Plugins\devel\$(PROJECT_NAME).p" prefix_auto="0" extension_auto="0" />

or whatever path you have LW installed to.

Anti-Distinctly
05-06-2008, 03:42 AM
I can't seem to find where to set the 'host application' so that the plugin will run. Any idea where the option is anyone? I've hunted through what documentation I could find, which I have to say, doesn't seem all that good. I can't find a thing about this option apart from it's listing as an option in an xml file. I'm pretty tired though...

Pomfried
05-06-2008, 04:36 AM
I can't seem to find where to set the 'host application' so that the plugin will run. Any idea where the option is anyone?

Click on "Project" in the menubar and then "Set programs' arguments...". You will find the host application setting on the very bottom of that panel :)

Doctor49152
05-06-2008, 04:41 AM
I can't seem to find where to set the 'host application' so that the plugin will run. Any idea where the option is anyone? I've hunted through what documentation I could find, which I have to say, doesn't seem all that good. I can't find a thing about this option apart from it's listing as an option in an xml file. I'm pretty tired though...

I have problems with that as well. This is my work around:

What I do is set the compile path so the ####.p gets put right into my /lightwave/plugins/devel/ folder thus over writing what was there before. Then I just run LW and execute the plugin (that I already added to the plugin list). Keep in mind that LW has to be closed when you compile the plug because it's locked or in use while its running. Code::blocks doesn't alert you that it can't over write the file at compile time.

To set the default path to the folder you want edit the XML template file and add the full path to your directory before the $(PROJECT_NAME).p

I also didn't include serv.def, servdesc.o, servmain.o shutdown.o, startup.o, username.o or the libserver.a files in my archive. You can compile with out them but you really should make them and copy them into the code::blocks templates directory. Then every plugin will have them copied into the source codes folder when created.

Anyone have an idea how to set code::blocks up to compile 64 bit versions of the plugins?

Pomfried
05-06-2008, 04:50 AM
Anyone have an idea how to set code::blocks up to compile 64 bit versions of the plugins?

From what I can tell, if you are using the MingW/GCC compiler, there is no way to do that right now, as GCC does not have any 64bit version at the moment (at least not for Windows, not sure about Linux :D).

If you are using a different compiler, I can't help you as I am using GCC myself :)

Doctor49152
05-06-2008, 04:58 AM
I am using the MingW/GCC that comes default with C::B (3.4.5 I think??)

Have you tried the lasted version? 5.1.4?? I was wondering if it would be better?

Anti-Distinctly
05-06-2008, 05:02 AM
Thanks for the prompt replies guys. Code::blocks really needs updated docs.
Doctor49152, I would usually adopt that method, but sometimes I really need to step through the code to find out what's going wrong. Also, I don't build server.lib, so I should include the servdesc.o, servmain.o shutdown.o, startup.o, username.o files in the directory.

I'm also currently working on a mac (it's my 'mobile' machine) as I wanted a consistent IDE, but I'm not the greatest programmer in the world and trying to compile for mac's is proving to be a bit more of a headache. Something about having to wrap dynlibs in a bundle. No idea.

Doctor49152
05-06-2008, 05:03 AM
Looking around I found this
http://sourceforge.net/projects/mingw-w64/

Pomfried
05-06-2008, 05:22 AM
No I actually haven't updated my GCC installation for quite some time, I still have the one that came with the Dev-C++ installation. Didn't see any need to update when I switched over to code::blocks :)

Yeah, now that I see that page of mingw64 I remember running across it when I looked for a 64bit compiler myself :D
But somehow I did not really try it out. Have to take a look at it, maybe it also has got a crosscompiler (don't want to install 64bit Windows right now, so it would be cool if it worked from 32bit Windows).

Thanks