Hey all, this is my 1st post so, hello, long time lurker 1st time poster etc etc.
I've a question, it's most likely very easy to answer (and probably has been donr before), but seing as I have round about 0 experience using linux or any non-IDE programming (other than a little UnrealScript and GBA stuff), I'm stuck.
All I want to do is compile C++ files instead of C, becuase I'm happier programming C++, I like my classes if nothing else:) I used the forum search but I think it sees it as searching for "C"+""+"" and returns 0 results.
I assume I have to change (or insert) a g++ instead of gcc in the makefile.
Any suggestions? (apologies for being such a newb:p)
Compiling C++ (this should be easy.. maybe)
You only have to link with the stdc++ library, no other changes is needed.
So add
to the LIBS statement in your makefile.
So add
Code: Select all
-lstdc++
Br, Sandberg
Sorted now, I'd tried renaming to .cpp but it threw up a bunch of errors about undefined functions. Turns out it was working, but I hadn't used
extern "C" { }
around my #includes, but the compiler didn't remind me that the non-standard .h files I'm using aren't c++, my own fault i should have noticed that.
ta for all the help.
extern "C" { }
around my #includes, but the compiler didn't remind me that the non-standard .h files I'm using aren't c++, my own fault i should have noticed that.
ta for all the help.