Question:
How can I get my C++ Files to compile and run?
Matt
2009-05-27 15:29:32 UTC
Ok, I've been reading a C++ textbook for a while now, and I want to start actually coding.

I can't seem to get a working compiler. The order I would want them for is OS X > Ubunu > Windows XP

X Tools for OS X isn't cutting it, becuase it complains about every code I enter. Even though if I press command shift r, and run through there, it works perfectly.

I've tried the Eclipse C++ plugin, but it gives an error about "binary files not found", which is quite irritating, and makes it so I can't compile and run it.

For Ubuntu I've used:
Anjuta IDE
Code::Blocks IDE
Eclipse
Geany
Kdevelop

For windows I've used dev-c++, but to no avail. I would press compile, and then run, and it would say it wasn't compiled.

So first person to get me a program compiled gets the points.


And I want this code to compile

And I don't care about any syntax here, because I'm learning it by a textbook, and this is exactly what the text has. I will be happy if I can have explicit instructions on how to compile using OS X terminal, just as long as I can know how to specify the exact path to the file. But then I need to know what filetype to save as >.>
----
#include
#include

int main(){
String Name;

cout<<"Enter your name: ";
cin >> Name;
cout << "Welcome, " << Name;
cout << "! Nice to meet you!" << endl;
return (0);
}
Three answers:
madmik3
2009-05-27 15:57:04 UTC
you are including



this is not the standard string class. and to compile it you will the correct need files. you can find them here if the book did not come with a cd.

http://www.lvp.com/datafile.htm



but the internet is likely better than any book. pick a compiler and an IDE and google c++ tutorials for it.
tbshmkr
2009-05-27 16:55:14 UTC
Choose your OS

=

Code::Blocks

http://www.codeblocks.org/downloads/5
anonymous
2009-05-27 15:50:10 UTC
hey in ubuntu i don't think u need to have a separate c++ compiler.



just use the terminal.





In windows install a software called Dev C++. It is quite useful.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...