Ok, no matter what compiler i use, i can never find a compiler that will build/compile/run a single file like the one I have used in my school.

i got Code::Blocks to compile my test file

the code is short:
// Test file

include <iostream>
int main()
{
    cout << "yarg!" end1;
return 0;
}

can anyone please help me? the book I have starts off with single file programs and this is a major mountain that I keep stopping at whenever I start to read this book.

Thank You :cool:

it should read: cout << "yarg!" << endl; instead.

And you're likely experiencing problems with the std:: namespace. Try prefixing cout and endl with std:: .

Or, if you don't like doing that, just add

using namespace std;

after you include <iostream>.

commented: hehe sorry. +4

// Test file

include <iostream>
using namespace std;
int main()
{
    cout << "yarg!" << end1;
return 0;
}

No errors, yet the run, build, and other buttons of that sort are grayed and unusable.

You probably failed to create a new project. Select menu item File --> New Project, then select the Console Project icon then fill in the rest of the information. After that those buttons and menu items will be enabled.

It should be endl, not end1.

Also, you forgot to put a # symbol before 'include'. It should read:

#include <iostream>

Ok, now it works, i just started a new project, didnt even have to include the test file in it, but anyways thank you guys

also, how do you put the code in the special formated text thing on this forum?

Use code tags.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.