Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: rose1975 on June 30, 2017, 02:20:01 am
-
I am a c++ beginner, knowing little about how to setup platform for running c++...
So I install codeblocks (codeblocks-16.01-setup), and MinGW(mingw-get-setup, which is installed at C:\program files(86)\codeblocks\MinGW)
Then, I copied the following to a new file made when running codeblocks,
// This is my first program is C++
/* this program will illustrate different components of
a simple program in C++ */
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!";
return 0;
}
But, I can't get the results as shown as others online....
actually, it pops up
information: it seems that this file has not been built yet, do you want to build it now:
Yes/No/Cancel
and if you click No, it pop up dos screen: ask you press any key to return. Build Message says:
||=== Build file: "no target" in "no project" (compiler: unknown) ===|
C:\C++\Untitled1.c|5|fatal error: iostream: No such file or directory|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
So, what shall I do next? any help is apreciated!
-
Read this FAQ http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F (http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F)
Quote from FAQ Remember the file extension matters: *.c is compiled as C file, *.cpp is compiled as C++ file.
Edit: CB is designed to compile code inside of CB projects; if you do NOT want to use CB projects I suggest you think twice about why you do NOT wish to use CB projects.
Tim S.