User forums > Using Code::Blocks
Resources with code blocks
chrishowarth:
Hello ~ my first post!! :D
I've just downloaded the Code::Blocks IDE, and I was wondering how to use resource (.rc) files with it? I had to delete the one already included with my Dev-cpp project, as I got the error while compiling it in Code::Blocks... oh, I've forgotten. I'm not on my computer. A 'Win something.exe' errors. But anyway, I haven't been able to find any support for them yet. Prove me wrong! Is there anything that I can do?
~ Christopher Howarth
TDragon:
Yes, Code::Blocks has full support for using .rc files!
Enable full command line logging (Settings->Compiler and debugger->Global compiler settings->Other->Compiler logging), and post the contents of the Build Log here.
chrishowarth:
I think this is it? After I had done what you asked I re-added the resource, attempted to build, and copied to contents of the 'Build Log' tab. Is this correct? If it is, here is what I got:
--- Quote ---Project : main
Compiler : GNU GCC Compiler (called directly)
Directory : C:\Documents and Settings\Christopher\My Documents\Christopher's Stuff\Personal\C++\My Projects\Win32 Code Blocks\
--------------------------------------------------------------------------------
Switching to target: default
windres.exe -i about.rc -J rc -o .objs\about.res -O coff
windres.exe: about.rc:2: syntax error
Process terminated with status 1 (0 minutes, 1 seconds)
--- End quote ---
TDragon:
It's telling you there's an error in the syntax on line two of your resource file. Let's see that line and its immediate context.
chrishowarth:
OK - Oh, and by the way, I tried another resource file, and got an error. Code::Blocks also didn't recognisr the file extention and asked me how to open it. The resource file syntax was taken from a WinAPI tutorial website.
--- Code: ---ABOUTDLG DIALOG 0, 0, 155, 102
STYLE DS_MODALFRAME | DS_3DLOOK | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "About Elixir ID3 Editor"
FONT 8, "MS Sans Serif"
{
CONTROL "&OK", IDOK, "BUTTON", BS_DEFPUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 6, 83, 50, 14
CONTROL "&Cancel", IDCANCEL, "BUTTON", BS_PUSHBUTTON | BS_CENTER | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 95, 83, 50, 14
CONTROL "About This Program", -1, "button", BS_GROUPBOX | WS_CHILD | WS_VISIBLE | WS_GROUP, 5, 5, 144, 73
CONTROL "© 2007 by Christopher Howarth, Elixir Software.\n\nNote: This application was created in pure C/C++, and is open source. ", -1, "static", SS_CENTER | WS_CHILD | WS_VISIBLE, 10, 27, 120, 50
}
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version