Code::Blocks problem (Please help)

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Code::Blocks problem (Please help)

Post by cobra »

Hello. I recently switched over to Code::Blocks, and I love this compiler! It beats DevC++ by far.

Anyway, I simply need to change the icon of my exe. In DevC++ this method (the standard method) works fine, but there's some problem to do with MingW, apparently.


I get these errors when I link my project to my resources.rc file, that only has this:

DEFAULT_ICON ICON "fighterstw.ico"


The errors are as followings:

Code: Select all

||=== FightersTW, default ===|
D:\CodeBlocks\MinGW\lib\gcc\mingw32\3.4.5\include\stddef.h|213|error: expected constructor, destructor, or type conversion before string constant|
D:\CodeBlocks\MinGW\include\stdio.h|191|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\stdio.h|191|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\stdio.h|202|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\stdio.h|202|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\stdio.h|206|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\stdio.h|206|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\stdio.h|216|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\stdio.h|216|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\stdio.h|217|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\stdio.h|217|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\stdio.h|297|error: expected constructor, destructor, or type conversion before "fread"|
D:\CodeBlocks\MinGW\include\stdio.h|298|error: expected constructor, destructor, or type conversion before "fwrite"|
D:\CodeBlocks\MinGW\include\stdio.h|446|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\stdio.h|446|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\stdio.h|450|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\stdio.h|450|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\stdio.h|480|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\stdio.h|480|error: ISO C++ forbids declaration of `n' with no type|
D:\CodeBlocks\MinGW\include\stdio.h|482|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\stdio.h|483|error: ISO C++ forbids declaration of `n' with no type|
D:\CodeBlocks\MinGW\include\wchar.h|171|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\wchar.h|171|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\wchar.h|189|error: expected constructor, destructor, or type conversion before "wcsftime"|
D:\CodeBlocks\MinGW\include\wchar.h|204|error: expected constructor, destructor, or type conversion before "wcscspn"|
D:\CodeBlocks\MinGW\include\wchar.h|206|error: expected constructor, destructor, or type conversion before "wcslen"|
D:\CodeBlocks\MinGW\include\wchar.h|207|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\wchar.h|207|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\wchar.h|208|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\wchar.h|208|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\wchar.h|209|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\wchar.h|209|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\wchar.h|212|error: expected constructor, destructor, or type conversion before "wcsspn"|
D:\CodeBlocks\MinGW\include\wchar.h|215|error: expected constructor, destructor, or type conversion before "wcsxfrm"|
D:\CodeBlocks\MinGW\include\wchar.h|229|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\wchar.h|229|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\wchar.h|230|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\wchar.h|230|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\wchar.h|236|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\wchar.h|236|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\wchar.h|237|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\wchar.h|237|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\wchar.h|253|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\wchar.h|253|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\wchar.h|254|error: `size_t' has not been declared|
D:\CodeBlocks\MinGW\include\wchar.h|254|error: ISO C++ forbids declaration of `parameter' with no type|
D:\CodeBlocks\MinGW\include\wchar.h|277|error: expected constructor, destructor, or type conversion before "mbrlen"|
D:\CodeBlocks\MinGW\include\wchar.h|279|error: expected constructor, destructor, or type conversion before "mbrtowc"|
D:\CodeBlocks\MinGW\include\wchar.h|281|error: expected constructor, destructor, or type conversion before "mbsrtowcs"|
D:\CodeBlocks\MinGW\include\wchar.h|283|error: expected constructor, destructor, or type conversion before "wcrtomb"|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|

I have it all linked, too, to the MingW.

Settings are like this:

Search Directories:
D:\CodeBlocks\MinGW\include
D:\CodeBlocks\MinGW\include\c++\3.4.5
D:\CodeBlocks\MinGW\include\c++\3.4.5\mingw32
D:\CodeBlocks\MinGW\include\c++\3.4.5\backward
D:\CodeBlocks\MinGW\lib\gcc\mingw32\3.4.5\include


Linker:
D:\CodeBlocks\MinGW\lib
D:\CodeBlocks\MinGW\lib\gcc\mingw32\3.4.5




Any ideas? I used the Code::Blocks that is bundled with the MingW that comes with it, so it should work??

I've searched all over, and I found no help.


Thank you in advance.
Josiah Hartzell
Image
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Re: Code::Blocks problem (Please help)

Post by Acki »

cobra wrote:In DevC++ this method (the standard method) works fine, but there's some problem to do with MingW, apparently.
C::B and DevCpp are using the same compiler by default (MinGW/GCC)...
remember this and learn the difference between compiler and IDE !!! :lol:

I'm not sure if this error is related to the resource file though...
but I'll tell you how I do it (also with C::B)...
I use 2 files:

resources.rc

Code: Select all

#include "resources.rch"

prgIcon ICON DISCARDABLE "icon.ico"
resources.rch

Code: Select all

#ifndef RESOURCES_H
#define  RESOURCES_H

#define prgIcon 1

#endif //  RESOURCES_H
but I think you can miss the include file thogh, but I also always include it in main.cpp... ;)

but if you don't want to use the include file then probably the resource file must look like this:

Code: Select all

1 ICON DISCARDABLE "icon.ico"
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

Thank you, I'll try.

Acki wrote:C::B and DevCpp are using the same compiler by default (MinGW/GCC)...
remember this and learn the difference between compiler and IDE !!!
Well, I know they use the same compiler, and I know the difference between compiler and IDE :wink:

I just meant, in DevC++, I never got that error even if I used that same style to get the .exe icon. :)



EDIT:

I did that, it still doesn't work... I don't really understand.
Josiah Hartzell
Image
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

cobra wrote:Well, I know they use the same compiler, and I know the difference between compiler and IDE :wink:
well, this sentence tells me the opposite:
cobra wrote:In DevC++ this method (the standard method) works fine, but there's some problem to do with MingW, apparently.
how could it be a problem to do with MinGW if they both use it ?!?!? :twisted:
cobra wrote:I did that, it still doesn't work...
that's what I thought and mentioned already... ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

:P Well, what I mean is, I think there's a problem in maybe configuration with MingW and Code::Blocks? At least in the version I have. Maybe I'm doing something wrong. I simply did what you said, and used #include "resources.rc" but it gets all of those errors.
Josiah Hartzell
Image
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

I think your problem is with the search directories...
Also you shouldn't need to define them, because they are standard dirs for C::B and defined under global compiler settings... :lol:
the only directories (beside specials like Irrlicht's) C::B needs are:
Includes: Drive:\CodeBlocks\MinGW\include
Libs: Drive:\CodeBlocks\MinGW\lib

but like I said, you shouldn't need to define them... ;)
Last edited by Acki on Sat Mar 21, 2009 8:26 pm, edited 1 time in total.
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
cobra
Posts: 371
Joined: Fri Jan 23, 2009 2:56 am
Location: United States
Contact:

Post by cobra »

WOW! I fixed it!

It really had nothing to do with any of it. Instead of including it in my source, I just set it to compile that file.

:lol:

Thank for your help anyway. Sorry for my lack of understanding, but I think I get the hang of C::B now.
Josiah Hartzell
Image
Post Reply