gcc
Michael Kearey
mutk at iprimus.com.au
Thu Mar 25 22:49:47 UTC 2004
Behemoth8u wrote:
> Hi everyone,
> I installed Fedora on my computer a few days ago. I figured I would
> try out the c++ compiler, so I made a simple program and ran gcc on it.
> However, I get errors about things in the standard library files
> (<iostream>). Anyone have any suggestions? This is a fresh install.
> Thanks for any help!
>
>
Some details would be really good. ie, example program you tried, g++
compile command you used ??.
Here is a simple one:
#include <iostream>
/*using namespace std;*/
int main (int argc, char **argv)
{
cout << "Hello world\n";
}
Notice the /*using namespace std;*/ bit. You either uncomment it, or
use full qualification to cout ( std::cout)
You need these rpm packages installed:
gcc-c++-3.3.2-1
libstdc++-devel-3.3.2-1
and possibly compat-libstdc++-devel-7.3-2.96.118 depending on what you
are doing..
Note that these are probably not the versions that come with ISO of
Fedora, I keep my system up to date with yum.
Finally how to compile it - 'g++ -o Hello Hello.cpp' will compile
source file Hello.cpp and save the binary in 'Hello' .
Cheers,
Michael
More information about the fedora-list
mailing list