News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Can't compile a simple program, help?

Started by strangecanadian, March 25, 2012, 06:52:31 PM

Previous topic - Next topic

strangecanadian

I was recommended to use codeblocks with c++ so I tried it, but every time I try to compile a simple hello world program
#include <iostream>
namespace std;
int main()
{
    cout << "Hello world" << endl;
    return 0;
}


Selection for new project: console application > C++ > title1 etc. > multiple compilers attempted (GNU GCC, MS visual c++ 05/08, Borland C++ Compiler) & Debug/Release configuration both checked.
I create a new empty file and save it, type the code, and when i press build I get this error in the build log
Quote"eishf - Debug" uses an invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]. Probably the toolchain path within the compiler options is not setup correctly?! Skipping...

I just want to compile a program, any help please?

Warren

Hi there Canadian!
U forgot "using" before namespace std;

Like this:

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
    return 0;
}

:)
Warren

strangecanadian

oh thank you, i fixed that but i'm still getting the same error :(

stahta01

Install a Compiler on your Computer.
Determine where you installed the compiler
Configure Code::Blocks to use the Compiler

Before asking anymore questions read the Code::Blocks FAQs
http://wiki.codeblocks.org/index.php?title=FAQ

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]