| ojima (9) | |||
|
Hello everybody! I've recently started programming in C++, so I don't know much about errors. I've just created a new program, but when I'm trying to execute the code, Dev-C++ (the compiler I'm using) shows 2 errors.
It doesn't show a location, so I don't know where the error is. Does anybody know what this means? - Ojima | |||
|
|
|||
| Davichococat (17) | |
|
Could you submit yours code which you think is causing the error, the whole file, or just the part the compiler points to? Thanks. | |
|
|
|
| Moschops (5981) | |
|
It means your project settings are bad. ou need to pick whatever passes for just plain C++ code. No Win16 (Win16? Yikes - I presume you're not using a pre Windows 95 OS?) or other such settings. Which version of Dev-C+pp are you using? If it's from here: http://www.bloodshed.net/devcpp.html please stop using it and get something else. | |
|
Last edited on
|
|
| ojima (9) | |
|
@Davichococat It doesn't say in what line the code is, so I can't tell you where the mistake could be. @Moschops What Dev-C++ should I use then? | |
|
|
|
| Moschops (5981) | |
|
The mistake is that your project settings have told the linker that your code contains a WinMain16. It's not a line of your code causing the problem - it's that your code (and all the libraries it is looking in) doesn't contain what it's looking for. Here is an article talking about not using Dev-C++ and giving some fine alternatives. http://www.cplusplus.com/articles/36vU7k9E/ | |
|
|
|
| ojima (9) | ||
|
@Moschops Okay, I'm now using Code::Blocks 10.5, but I'm still getting the same error,
What should I do to fix this? | ||
|
|
||
| Moschops (5981) | |
| Let's see the code, and what compiler are you using? | |
|
Last edited on
|
|
| ojima (9) | |||
|
@Moschops Okay, here's the code:
It should create a simple screen, it's not much yet. It's a program I first programmed in BASIC, but when I saw the limited possibilities in BASIC, I thought I might wanted to reprogram it in C++. - Ojima | |||
|
|
|||
| Moschops (5981) | |
| There's no main function. Where does your code start? Nowhere, because there's no main function. C++ programs start at main. | |
|
|
|
| ojima (9) | |
|
hmm, tried it, I renamed Setup to main (btw, thanks, didn't know that :)) Now I'm getting no more warnings or errors. Thanks! (and now I see what a complete n00b I am...) - Ojima | |
|
|
|