Code::Blocks aesthetic build settings

Started by
1 comment, last by Decrius 14 years ago
I'm still pretty new to Code::Blocks and I have two questions. 1) I have a dozen DLL files sittin in my build directory along with my game.exe file. This is pretty ugly and confusing for users. Is it possible to throw those DLLs into a lib folder and tell Code::Blocks where to look for them? If so, how? 2) If I wanted to create a custom icon so that my .exe would display a cute little picture of my main character when viewing the file in a folder, would I use some setting in Code::Blocks or an external application which embeds that information inside a preexisting .exe file? Thanks in advance.
Advertisement
1) You can certainly tell Code::Blocks to put your DLLs into some subfolder, simply put some path (whatever you want) into the target's output executable field. However, do note that this will mean that either you must add that folder to PATH or Windows won't find your DLLs (not a good thing!). By default, Windows only searches in the executable's folder (and in system32 and such), not any arbitrary other folders.
Or, you must load them by hand (in which case your application must know where to look for them).

2) You would first use an icon editor for such as Microangelo, or if you aren't willing to spend money, you could opt for IcoFX.
Next, you need to create a resource file. The file extension should be .rc (so Code::Blocks knows that it needs to call windres to process it). The file must contain at least one ICON definition, such as for example (assuming your icon is in the file app.ico):
101 ICON MOVEABLE DISCARDABLE "app.ico"

Your resource file can (and probably should) contain other information such as VERSIONINFO and RT_MANIFEST. Search MSDN for information on what to put into those.

You can also include other resources such as cursors and dialogs, of course. In that case, it may be a good idea to use a specialised resource editor, since as things get more complex, it can get painful to do all that in a text editor (although it sure is possible).
Quote:Original post by samoth
Or, you must load them by hand (in which case your application must know where to look for them).


Can you link me to instructions on how to do this exactly? I've tried adding directories to the build target field in the project settings, but that didn't seem to do anything.
Mainly what samoth said there.

Okay, I also just found out this setting. I normally dump everything in just the projects directory, but this worked for me and is actually much nicer:

With your project active, go to the menu Project -> Properties... -> Build targets (tab).
On the left select the build target you which to change it for (Debug or Release generally), on the right side near the bottom you can change the 'execution working dir'. This is probably '.', meaning it runs from the project directory. Change this into the same directory as 'output filename', something like 'bin\Debug\' or 'bin\Release\'.
Now you can move all your DLL's and files that get loaded in the same directory as the executable.

For icons, what you need is this: http://www.winterdrache.de/freeware/png2ico/
Then make PNG's for 16x16, 32x32 and maybe 64x64 and use that tool in this way: 'png2ico icon.ico 16.png 32.png', icon.ico being the output etc.

If you want vector graphic icons (is that even possible in Windows?), then you'll need some big program.
[size="2"]SignatureShuffle: [size="2"]Random signature images on fora

This topic is closed to new replies.

Advertisement