Adding an icon to FB app

New to FreeBASIC? Post your questions here.
Clyde
Posts: 235
Joined: Jan 21, 2006 14:03
Contact:

Post by Clyde »

Get the same error in the Free Basic command prompt also.
Clyde
Posts: 235
Joined: Jan 21, 2006 14:03
Contact:

Post by Clyde »

yep my bas projects are associated with FBIDE, still getting the error. :(
Fragmeister
Posts: 545
Joined: Nov 08, 2005 14:36

Post by Fragmeister »

Try this:

Code: Select all

fbc sourcefile.bas resource.rc -s gui
That's how I do it. Also, might try removing that #define, I don't think it's necessary
Clyde
Posts: 235
Joined: Jan 21, 2006 14:03
Contact:

Post by Clyde »

Im now beginning to think that a .rc file should have some kind of associated icon itself? And might be why its not either recognizing it as a special source file, or something like that. As im always greeted with it not being able to open it.

So brings me to ask, when you save the resource once entered into Notepad, with Save As and the option, all files. And then the name of it eg: thisresource.rc . do you in explorer then see an association symbol; or is it just as a notepad file symbol?

If the answer to the above is yes, then do you have any idea on how i can get them to be associated as an rc source file?

Hugest of thanks,
Clyde.
PlayerOne
Posts: 173
Joined: Aug 15, 2005 18:58
Location: UK

Post by PlayerOne »

The .rc files are compiled by GoRC.exe, which is in your FreeBASIC\bin\win32 folder.

Perhaps it's not finding the icon file? Although it looks like it's not finding the .rc file. Are both in the same folder as your .bas files?
Clyde
Posts: 235
Joined: Jan 21, 2006 14:03
Contact:

Post by Clyde »

Yes they are PlayerOne dude.
Clyde
Posts: 235
Joined: Jan 21, 2006 14:03
Contact:

Post by Clyde »

And i just tried compiling with addicon.rc.txt and no errors found, but no icon. :( And it doesnt make the obj file.
yetifoot
Posts: 1710
Joined: Sep 11, 2005 7:08
Location: England
Contact:

Post by yetifoot »

@clyde

what version FB are you using?

I'm sure i read somewhere in the forum that there was an issue where resource files weren't being passed in quotes. Although i would expect this would only affect files with a space in the filename, maybe this is the problem?
Clyde
Posts: 235
Joined: Jan 21, 2006 14:03
Contact:

Post by Clyde »

Ahaha, thats brilliant. Working now, greatest.
( btw, big appologies for topic hijacking )

And a tip make sure if your using notepad to create resource files, that it is actually saving them as an .rc document and not as a txt doc. :)

As a concluding question. Once a resouce ie, an exe has been set to the executable. Say if you make changes, do you / me / farmer Giles, then have to compile again with the resource, or is it now set in stone from the first time around?
Imortis
Moderator
Posts: 1925
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Post by Imortis »

farmer Giles
Tolkin Reference? Right on!
Fragmeister
Posts: 545
Joined: Nov 08, 2005 14:36

Post by Fragmeister »

Say if you make changes, do you / me / farmer Giles, then have to compile again with the resource, or is it now set in stone from the first time around?
yes. Every time you compile, if you want the icon to show up, you must include the .rc file in the command line, because the .exe file is completely rewritten.
Clyde
Posts: 235
Joined: Jan 21, 2006 14:03
Contact:

Post by Clyde »

Cool and thankyou.
Cheers, Clyde :)
BlackWizard
Posts: 73
Joined: Jan 21, 2006 21:32
Location: Poland

Post by BlackWizard »

Hello, but how to change small icon, in the upper left corner of application?
thanks, BW.
Fragmeister
Posts: 545
Joined: Nov 08, 2005 14:36

Post by Fragmeister »

Make sure that the name of your icon in your .rc file is FB_PROGRAM_ICON:

Code: Select all

FB_PROGRAM_ICON ICON myicon.ico
Also, try making your icon with an icon making program.
BlackWizard
Posts: 73
Joined: Jan 21, 2006 21:32
Location: Poland

Post by BlackWizard »

ahhh this way....
It was said here....

sorry, I didn't saw it.
Last edited by BlackWizard on Sep 18, 2006 14:05, edited 1 time in total.
Post Reply