![]() |
|
#1
|
|||
|
|||
[Linker error] undefined reference to `WinMain@16'I'm using Dev-C++ 4.9.9.2 to compile a program I wrote about five years ago.
I recall that it compiled without errors when I first wrote it. I had to change a few things, because I guess the code was getting a little old. Anyway, I got rid of all of the errors except this WinMain@16 thing. I've noticed that this can be a problem if you're writing a console program and accidentally have your project set to Windows Program, but I've checked this and it's definitely set as a console program. So now I'm not exactly sure what to do. My code is attached to the bottom of this post...please help if you can! chat.cpp CPP / C++ / C Code:
and chat.h CPP / C++ / C Code:
Thanks a lot for looking. |
|
#2
|
||||
|
||||
Re: [Linker error] undefined reference to `WinMain@16'You don't have a main function declared. You may be missing one of the original source files. If you simply add:
CPP / C++ / C Code:
your code will compile just fine. Every executeable needs a entry point. 'main' is the default entry point for console apps. |
|
#3
|
|||
|
|||
Re: [Linker error] undefined reference to `WinMain@16'Well, thanks.
It compiles just fine, like you said. You might be right about me missing something, because...it doesn't actually WORK. Haha. Maybe I had a main.cpp lying around somewhere. I dunno~ Thanks though! ![]() |
|
#4
|
||||
|
||||
Re: [Linker error] undefined reference to `WinMain@16'Chris' fix allowed the code to compile, but the program doesn't do anything with this fix. You undoubtedly have (had?) a main laying around somewhere otherwise it would not have compiled even 5 years ago.
__________________
Got a cough? Go home tonight and eat a whole box of Ex-Lax. Tomorrow, you'll be afraid to cough. -- Pearl Williams |
|
#5
|
|||
|
|||
Re: [Linker error] undefined reference to `WinMain@16'Probably "had," as I can't seem to find it.
Oh well. Thanks a lot, guys |
Recent GIDBlog
Stupid Management Policies by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| G++ question... | TreyAU21 | C++ Forum | 10 | 24-Feb-2006 09:45 |
| How to interpret characters as they are being entered? | nkhambal | C Programming Language | 18 | 14-Feb-2006 11:41 |
| c++ inheritance | illbemissingu | C++ Forum | 14 | 23-Oct-2005 18:35 |
| Linker Errors with Dev-C++ 5 | Gamer_2k4 | C++ Forum | 1 | 18-Apr-2005 12:08 |
| fltk-2.0 cvs | Plumb | FLTK Forum | 20 | 13-Nov-2004 08:10 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The