Author Topic: Trouble with resources and CodeBlocks  (Read 5140 times)

Max

  • Guest
Trouble with resources and CodeBlocks
« on: February 08, 2006, 06:44:47 pm »
Hi *.*

I am having some trouble using rc files.

A) If I put every resources definition in one single file foo.rc compiling the foo.rc with windres the resulting executable, linked with the foo.res, works perfectly.

B) If I put the resources definition in several .rc files I got trouble. Compiling every .rc files separately
in different .res files and then linking all the .res files, the resulting executable does not work. The resources
seems not present.

C) I used DevC++ in the past, I switched to CodeBlocks some days ago. DevC++ is used to make a
*_private.rc file in which all the rc file are #included. So at the end I was compiling a single rc file.
And everithing work.

Question.

Are there any reasons for this behaviour? Is it really required to use, compile and link a single *.rc file?

Thanks for your help

Max

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Trouble with resources and CodeBlocks
« Reply #1 on: February 08, 2006, 06:54:24 pm »
Hello,

Could you say which C::B version are you using?

And just a suggestion. Did you make a search in the forum? There are quite some posts about .rc files and may be one of them could help you or at least give you the right direction to go.

Best wishes,
Michael

Max

  • Guest
Re: Trouble with resources and CodeBlocks
« Reply #2 on: February 08, 2006, 09:18:47 pm »
Dear Michael

Thank for your reply.

I am using the latest nightly build. I did a search in the Window forum and I found another post with exactly the same issue. But there was no clear answer (to me).

Basically is it true or not that I have to link an .res file only?

Max

Offline kkez

  • Almost regular
  • **
  • Posts: 153
    • WinapiZone
Re: Trouble with resources and CodeBlocks
« Reply #3 on: February 08, 2006, 11:25:33 pm »
Are there any reasons for this behaviour? Is it really required to use, compile and link a single *.rc file?
What's the problem with that?
Anyway, i think that this problem is not related to CodeBlock, but to MinGW.

If you explain what are you trying to accomplish, maybe we can find a workaround  :)

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Trouble with resources and CodeBlocks
« Reply #4 on: February 09, 2006, 08:32:12 am »
it's a known issue of MinGW windres - workaround it like you proposed already,
#include all your *.rc files in one file and compile this one.

Max

  • Guest
Re: Trouble with resources and CodeBlocks
« Reply #5 on: February 09, 2006, 10:18:34 am »
The issue appeared to me because I used DevCpp since last week. Switching to CodeB I used the old DevCpp projects files to create a new project. In DevCpp you can use several .rc files (it is more convenient to edit
small files focused on few resources). DevCpp automatically creates a *_private.rc in which all the .rc are included, then windres will compile the private file (a single file).
Because I was not aware about the MinGW issue (flagged by tiwag) and because CodeBlocks is not using a
*private.rc my project are no longer working.

Anyway the solution suggested by tiwag is simple and works. Now I have a single file resources.rc in which I include all the .rc files. Everything in OK now.

thanks.

P.S.

Codeblocks is a fantastic IDE. Much better than DevCpp. The developpers certainly deserve a donation.
I will donate ASAP.


Offline severach

  • Multiple posting newcomer
  • *
  • Posts: 44
Re: Trouble with resources and CodeBlocks
« Reply #6 on: February 15, 2006, 03:07:06 am »
This isn't just a Windres problem. It occurs with Borland and Digital Mars C++ too and I'm using RC.EXE out of the Windows SDK since neither of those built in resource compiles produce anything useful. Multiple .rc files compiled with RC.EXE and linked with Microsoft link work just fine. Watcom has yet to be tested.

The Dev-C++ method ends up being the best anyways because it supports conditionally including .RC files.