Stephni Posted April 17, 2009 Report Share Posted April 17, 2009 what I need to compile a c++ fille on Linux, as far as I know I've created my file with extension cpp by using the text editor such as KWirter, and then compile it with gcc, but it gives me long error message /tmp/ccb5v3PS.o: In function `__static_initialization_and_destruction_0(int, int)': 1.cpp:(.text+0x23): undefined reference to `std::ios_base::Init::Init()' /tmp/ccb5v3PS.o: In function `__tcf_0': 1.cpp:(.text+0x6c): undefined reference to `std::ios_base::Init::~Init()' /tmp/ccb5v3PS.o: In function `main': 1.cpp:(.text+0x8b): undefined reference to `std::allocator<char>::allocator()' Quote Link to comment Share on other sites More sharing options...
Greg2 Posted April 17, 2009 Report Share Posted April 17, 2009 Try compiling it with g++ instead of gcc. Welcome aboard! :) Quote Link to comment Share on other sites More sharing options...
Stephni Posted April 18, 2009 Author Report Share Posted April 18, 2009 Try compiling it with g++ instead of gcc. Welcome aboard! :) after compiling the code ......what I need to write to see the outputs on the shell screen, Is it the same as Fortran ./a.out Quote Link to comment Share on other sites More sharing options...
Greg2 Posted April 18, 2009 Report Share Posted April 18, 2009 Yes, you would execute the file with ./a.out You may need to make it executable first with chmod +x a.out You could also specify a name using the -o option g++ file-name -o new-file-name for more info, see 'man g++'. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.