How to compile program in Emacs

Hi guys,

Struggling a little here, I have a mac and am using emacs, but I can't seem to compile my program, I have tried
M-x compile
make -k

and that returns an error 2 code.

so I tried
g++ -o hello helloworld.cpp

and that returns an error 1 code.

How do I compile my programs so I can start programming please? Is there not just a simple way to compile in emacs.

Kind regards
Rob
For anyone finding this thread, I have solved my problem, the problem was in my simple hello world program, the one I tried to compile was:
1
2
3
4
5
6
7
#include <iostream>

int main()
{
     std::cout << "Hello World!" << std::endl;
    return o;
}


the return o should have been the number zero not the letter o. Silly typo, but it's fixed now.

Note to self, check syntax when setting up your environment.

Kind regards
Rob
Topic archived. No new replies allowed.