|
-
March 23rd, 2009, 09:25 AM
#31
Re: How do I give my program an icon?
Try it again. I should also noted that c:\mingw\bin> is the working directory.
1. Run cmd from the start menu
2. Change the current directory in the bin folder in your mingw installation
3. Run windres like this:
Code:
windres -i c:\resource.rc -o c:\resource.o
If still doesn't work, I suggest, you pray to St. Anthony of Padua that you may found the answer.
Last edited by richard_tominez; March 23rd, 2009 at 09:31 AM.
-
March 23rd, 2009, 11:03 AM
#32
Re: How do I give my program an icon?
Well thanks, once agian richard_tominez.
But, when I do that. The cd c:\mingw\bin
Gives me an invalid directory. Like it doesn't exits. However I can't see it either. (When I open up my C folder)
I'm on Windows Vista 32BIT: Home Premium, if that should do any different.'
EDIT: I used google, now I'm downloading that mingw.
Last edited by realchamp; March 23rd, 2009 at 12:59 PM.
-
March 23rd, 2009, 01:58 PM
#33
Re: How do I give my program an icon?
Okay, now I got it installed. It doesn't say unknow command anymore.
But when I try to compile it, I get these errors:
Code:
C:\Plugins\srcds>cd c:\mingw\bin
c:\MinGW\bin>windres -i C:\Plugins\srcds\resource.rc -o C:\Plugins\srcds\resourc
e.o
C:\Plugins\srcds\resource.rc:1:24: warning: no newline at end of file
windres: can't open icon file `resource.ico': No such file or directory
c:\MinGW\bin>pause
In my C:\Plugins\srcds\ folder I have these files:
resource.ico
resource.rc with this data:
Code:
101 ICON "resource.ico"
resource.bat with this data:
Code:
cd c:\mingw\bin
windres -i C:\Plugins\srcds\resource.rc -o C:\Plugins\srcds\resource.o
pause
And I do also have my main program.
EDIT:
Now I got the resource.o file.
Code:
C:\Plugins\srcds>cd c:/mingw/bin
c:\MinGW\bin>g++ resource.o c:/Plugins/srcds/srcds_beta.cpp -o main
c:/Plugins/srcds/srcds_beta.cpp: In function `int main()':
c:/Plugins/srcds/srcds_beta.cpp:88: warning: `_sleep' is deprecated (declared at
../lib/gcc/mingw32/3.4.5/../../../../include/stdlib.h:404)
c:/Plugins/srcds/srcds_beta.cpp:88: warning: `_sleep' is deprecated (declared at
../lib/gcc/mingw32/3.4.5/../../../../include/stdlib.h:404)
c:/Plugins/srcds/srcds_beta.cpp:213: warning: `_sleep' is deprecated (declared a
t ../lib/gcc/mingw32/3.4.5/../../../../include/stdlib.h:404)
c:/Plugins/srcds/srcds_beta.cpp:213: warning: `_sleep' is deprecated (declared a
t ../lib/gcc/mingw32/3.4.5/../../../../include/stdlib.h:404)
c:/Plugins/srcds/srcds_beta.cpp:223:2: warning: no newline at end of file
c:\MinGW\bin>pause
Why now this? 
Please someone help me!
I compiled my srcds_beta.cpp in VC++ 2008: Express Edition.
I didn't get any errors.
And now this:
Code:
C:\Plugins\srcds>cd c:/mingw/bin
c:\MinGW\bin>g++ resource.o c:/Plugins/srcds/srcds_beta.cpp -o c:\Plugin\srcds\s
rcds_beta.exe
c:/Plugins/srcds/srcds_beta.cpp: In function `int main()':
c:/Plugins/srcds/srcds_beta.cpp:88: warning: `_sleep' is deprecated (declared at
../lib/gcc/mingw32/3.4.5/../../../../include/stdlib.h:404)
c:/Plugins/srcds/srcds_beta.cpp:88: warning: `_sleep' is deprecated (declared at
../lib/gcc/mingw32/3.4.5/../../../../include/stdlib.h:404)
c:/Plugins/srcds/srcds_beta.cpp:213: warning: `_sleep' is deprecated (declared a
t ../lib/gcc/mingw32/3.4.5/../../../../include/stdlib.h:404)
c:/Plugins/srcds/srcds_beta.cpp:213: warning: `_sleep' is deprecated (declared a
t ../lib/gcc/mingw32/3.4.5/../../../../include/stdlib.h:404)
c:/Plugins/srcds/srcds_beta.cpp:223:2: warning: no newline at end of file
..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot open output file
c:\Plugin\srcds\srcds_beta.exe: No such file or directory
collect2: ld returned 1 exit status
c:\MinGW\bin>pause
Last edited by realchamp; March 23rd, 2009 at 02:47 PM.
-
March 23rd, 2009, 05:28 PM
#34
Re: How do I give my program an icon?
Someone please help. I wanna get this to work! 
Hehe, tell me if you need more information!
-
March 24th, 2009, 02:48 AM
#35
Re: How do I give my program an icon?
_sleep function is obsolete. Try including windows.h to use Sleep function as a replacement to it.
Last edited by richard_tominez; March 24th, 2009 at 02:53 AM.
-
March 24th, 2009, 06:30 AM
#36
Re: How do I give my program an icon?
I already included it. 
When I run my own program in VC++ 2008: Express Version, it works perfect. No errors at all! (with _sleep(2000))
Here's my headers:
Code:
#include <iostream>
#include <fstream>
#include <cstring>
#include <stdlib.h>
#include <string>
#include <direct.h>
#include <Windows.h>
#include <WinBase.h>
Last edited by realchamp; March 24th, 2009 at 07:49 AM.
-
March 25th, 2009, 12:27 AM
#37
Re: How do I give my program an icon?
Code:
#include <iostream>
#include <fstream>
#include <cstring>
#include <stdlib.h>
#include <string>
#include <direct.h>
#include <Windows.h>
#include <WinBase.h>
Windows.h is different from windows.h.
Anyways, your problem is how to give your program an icon. The important matter is you know the steps to give your program an icon. Create a simple Hello World program with your resource.o and see what you got.
Last edited by richard_tominez; March 25th, 2009 at 02:23 AM.
-
March 25th, 2009, 03:15 AM
#38
Re: How do I give my program an icon?
Now my program doesn't know "cout".
Here's my code:
Code:
// hello_world.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
int _tmain(int argc, _TCHAR* argv[])
{
cout << "Hello World!";
}
And error:
Code:
1>------ Build started: Project: hello_world, Configuration: Debug Win32 ------
1>Compiling...
1>hello_world.cpp
1>c:\plugins\srcds\beta\hello_world\hello_world\hello_world.cpp(9) : error C2065: 'cout' : undeclared identifier
1>Build log was saved at "file://c:\Plugins\srcds\beta\hello_world\hello_world\Debug\BuildLog.htm"
1>hello_world - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I included the <iostream> in the main file. Didn't work.
I also added the resource.o to resources.
It said "unknown rules" - I just ran throught and it worked.(I hope)
-
March 25th, 2009, 04:32 AM
#39
Re: How do I give my program an icon?
cout is a member of the std namespace. To use it:
Code:
std::cout << "Hello World!";
-
March 25th, 2009, 08:35 AM
#40
Re: How do I give my program an icon?
 Originally Posted by richard_tominez
cout is a member of the std namespace. To use it:
Code:
std::cout << "Hello World!";
Ohh well I forgot the:
Code:
using namespace std;
Thanks alot! I'm going to try it and give you a feedback!
- realchamp.
-
March 25th, 2009, 10:57 AM
#41
Re: How do I give my program an icon?
Hello, it works! No errors on compiling.
However when I use the project manager I don't get any .exe file? :/
So I can't really check if it works
-
March 26th, 2009, 05:43 AM
#42
Re: How do I give my program an icon?
No errors on compiling? How about on linking?
-
March 27th, 2009, 11:44 AM
#43
Re: How do I give my program an icon?
What do you mean by "linking?"
-
March 27th, 2009, 11:56 AM
#44
Re: How do I give my program an icon?
Victor Nijegorodov
-
March 27th, 2009, 12:33 PM
#45
Re: How do I give my program an icon?
I know what a "link" is.
Like a link to Google.
But I don't understand what he means with "on linking?"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|