I have not even really started to learn c++. I am still trying to setup NetBeans properly so I can practice/learn. It took me forever to get MiniGW and MSYS configured properly. Now I am trying to start following my book's tutorials and I'm stuck already. I have been trying different #include as well as several different variations like std::cout. Like I said before I am brand new at this, so please be patient. I am using NetBeans 8.0.2 on Windows 8.1.. Thanks
*
* File: newmain.c++
* Author: Matthew
*
* Created on May 31, 2015, 2:33 PM
*/
I'm not sure if it's on purpose, but you've posted two programs (neither of which uses code tags). The second one (starts at #include <iostream> ) will work if you put std:: in front of cout<< and a semi colon after return 0.
If that still doesn't work, then you didn't configure Netbeans correctly. It is probably one of the more difficult ones to set up in my humble opinion.
Since you are using Windows, I would recommend VS. They do supply a completely free version.
If you are adamant on not using VS, you can try Code::Blocks.
As someone who's used both, I'd actually suggest starting with neither. If you can, try and get a version of Quincy as it starts completely set up and even allows you to use graphics from the get go. Personally, if you're going to go with a mainstream IDE, I'd really recommend Code::Blocks as it promotes multiplatform programming which is basically always a good thing.
Thank you for your responses. @rlc4 i tried running that and this was the result.. @shadowmouse i will download quincy now thanks.
______________________________________________________________________
But as far as I can tell, Quincy hasn't been updated since 2008 (and it was a very minor update at that). The development on it seems to have ceased, which is NOT a good thing. C++ has had 2 new standards released sense then (C++11 and C++14).
Though it is not a good idea to start off using OS-Dependent code (like system.sleep()), it also isn't a good idea to start off with worrying about multiplatforming.
For starting off, there really is no benefit to use C::B over VS (and the same can be said the other way around).
Again, this seems to be a NetBeans oriented issue. After doing a bit of research, I found that the gcc compiler does not automatically include C++'s STL. g++ does, however.
newfile1.c++: In function 'int main()':
newfile1.c++:4:5: error: 'cout' was not declared in this scope
cout << "Hello, World!\n";
Your project configuration seems to be incorrect
You have two files: newfile1.c++ and newfile.cpp. You showed the code for newfile.cpp, but the one at fault is newfile1.c++ (that doesn't qualify the namespace)
You don't need those two files, just remove newfile1.c++ from the project.