same error still...
Maybe I should try a different compiler. Any recommendations?
same error still...
Maybe I should try a different compiler. Any recommendations?
Maybe it doesn't like:
int is_prime; // Boolean flag
is_prime = true;
Although true should give a value of 1 wouldn't it be more accurate to cast is_prime as a bool variable?
Newbie programmer here, too. Just putting in my 2c.
Windows xp
Well there's nothing wrong with Visual Studio, perhaps your install didn't go right. I dunno. If you want to get these simple apps up and running real quick with a more minimalistic IDE try Dev C++.
Here's the link to download Dev C++:
http://sourceforge.net/project/downl...or=superb-east
Of course since Dev C++ uses a different compiler than Visual Studio, you'll want to remove the #inlcude <stafx.h> from all your code.
This doesn't mean you should give up on Visual Studio though. Use the other compiler for now so you don't feel so frustrated and so you can get back to enjoying programming. I would later try reinstalling Visual Studio.
Ubuntu Desktop
GCC/G++
Geany (for quick projects)
Anjuta (for larger things)
Note my #1 error:
#inlcude
lol.
Ubuntu Desktop
GCC/G++
Geany (for quick projects)
Anjuta (for larger things)
Awesome. Thanks I will.
Yeah I'm finding it very hard avoid getting frustrated right now. These inexplainable errors are the worst.
Trust me, If you continue programming, seemingly inexplicable errors will occur, and will drive you mad. But remember computers don't purposely try to drive you mad, be sure the errors are always explicable, though they may be difficult to trace.
Sometimes it's the simplest little error that can cause you big problems. That's why modularizing things is so important (ie breaking one large problem down into smaller ones).
Ubuntu Desktop
GCC/G++
Geany (for quick projects)
Anjuta (for larger things)
Unless it's changed RECENTLY, "Subsystem:Console" is the way to make a console app. If you have "Subsystem:Windows", it will make a Windowing app, which, apart from other things, requires that you have a WinMain() instead of main() - but other things change too.
It may be other settings that got set by selecting a Windows app that cause problems too. There definitely should be some sort of indication somewhere as to what the problem is, but dudeomanodude's suggestion of starting with an "Empty" project is a good one. Also make sure that you set it as "Console".
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Try compiling from the command line with 'cl'. That way, you can check if it's the compiler or IDE that is messing it up.
cl source.cpp
I think that is the proper format.