OF project obj\release\icon.res problem with code::blocks

Hi windows OF ally!

I am having a problem with running external projects in code::blocks. The projects are from our teacher in the OF class and it is made available for windows as well. In the build message panel of code::blocks, I have this warning shows up every time I open a new project:

Obj\Release\icon.res no such file or directory
(and the little icon of “icon. rc” under “Resources” of the project looks broken in the management panel…)

I am using code::blocks (12.11) and I have re-checked my installation, folder order, compiler location as well as generating a new project with project generator and copy and paste the project’s .h and .cpp file in the new one…basically everything that I thought might has caused this issue. And it doesn’t work.

As a OF newbie, I am sending my SOS here. Anybody happen to have any suggestions/ solutions? Please let me know if further information is needed. Big thanks!

1 Like

It sounds like the icon.rc file is missing. It’s just a little text file that can be found here:

https://github.com/openframeworks/openFrameworks/tree/master/scripts/win_cb/template

Try downloading the file or copying it into your project directory.

If you create your projects using project generator this file should be copied into your project folder … but it sounds like it went missing somehow.

Also note that the icon.rc file used for codeblocks files sometimes conflicts with the icon.rc used for visual studio files, so make sure you have the right one in your directory.

Good luck!

Thanks for the reply! I copied the file into my project file and a new warning showed up when I tried to run the project:

fatal error: when writing output to : Invalid argument|
syntax error
preprocessing failed.
||=== Build finished: 3 errors, 0 warnings (0 minutes, 0 seconds) ===|

Did I do something wrong during the copy & paste process?

Hmmm … it appears that something went strange … what version of openFrameworks are you using? Also, I’d double check to make sure that the file icon.rc file is exactly the same as the one that is linked – sometimes copying and pasting can cause line endings and other encoding problems …

I am using of_v0.8.3_win_cb_release. The .rc file did changes to something super long during the copy, I’ve updated it so that it is the same as the linked one-

//TODO: figure out how to do debug and release icons
MAINICON ICON “…/…/…/libs/openFrameworksCompiled/project/win_cb/icon.ico”

And after I run it, here’s a another new warning-

||=== A_MyObj, release ===|
||can’t open icon file `…/…/…/libs/openFrameworksCompiled/project/vs2010/icon.ico’: No such file or directory|
||=== Build finished: 1 errors, 0 warnings (0 minutes, 0 seconds) ===|

Hmm … its’ strange because it’s looking for the icon in the visual studio directory (vs2010) which won’t exist in the of_v0.8.3_win_cb_release – I would recommend cleaning your project to make sure that it is not pulling from some old code. It looks kind of like the project was created with the VS release and then moved to the win_cb release or something …

As an alternative, it may be worthwhile to rebuild the project files with the project generator shipped with the release.

Rebuild worked! Thank you so much! :smiley:

1 Like

I’m in the same class and having the same problem except I found another mistake after following the same steps. After adding the icon.rc and changing my compiler to C++11 on the SETTINGS> COMPILER of Code::Blocks (Windows) I get the following error:

||=== openFrameworksLib, release ===|
C:\of_v0.8.3_win_cb_release\libs\openFrameworks\gl\ofVbo.cpp||In member function ‘void ofVbo::setVertexData(const float*, int, int, int, int)’:expressionless:
C:\of_v0.8.3_win_cb_release\libs\openFrameworks\gl\ofVbo.cpp|330|error: cannot convert ‘ofPtr’ to ‘bool’ in assignment|
||=== Build finished: 1 errors, 0 warnings (0 minutes, 45 seconds) ===|