User forums > Using Code::Blocks
Resources
Decrius:
Hello all, I'm new here. Code::Blocks is great, but I have one problem.
I have Icon's and Menu's that I want to place in a resource file. The Icon I define with LoadImage...
But I couldn't find anything in the editor to do something with resources.
What extension should a resource have?
How to 'link' them to your file?
A comprehensive question: What and how with resources.
I hope someone can answer here, I tried the DevShed forum, but they didn't knew anything about resources in Code::Blocks.
Decrius
TDragon:
The underlying structure for Win32 resources in any IDE is the .rc file. In Code::Blocks, if you add a file with the .rc extension to your project, it will be compiled with the resource compiler and linked into your program.
Unfortunately I've never come across a good reference for the structure of a .rc file (maybe someone else can chime in here?); I just learned by looking at the contents of the files Visual Studio produces.
Also, I've started using wxWidgets for all my GUI development, which sits on top of all the Win32 functionality and uses a different format for its resources, and is in my humble opinion far and away easier to work with.
Decrius:
Okay, thank you, with project you mean just a .c file? Or that thing they put into the program which does everything except what I need (GUI project thing)?
Decrius:
I tried the console application project, deleted the main.c, added the .c file of my GUI program, added the resource file (.rc). But when I try to compile (is that the same as 'build'?) it says in the build log:
gcc: Files\CodeBlocks\include\taco\resources\resource.rc: No such file or directory
gcc: warning: `-x c' after last input file has no effect
gcc: no input files
windres.exe: no resources
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 1 warnings
While I selected the resource from the list!
Decrius
Decrius:
I think I got it working, maybe project are better than I thought :D
Decrius
Navigation
[0] Message Index
[#] Next page
Go to full version