Stephni Posted April 17, 2009 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()' Link to comment Share on other sites More sharing options...
Greg2 Posted April 17, 2009 Share Posted April 17, 2009 Try compiling it with g++ instead of gcc. Welcome aboard! :) Link to comment Share on other sites More sharing options...
Stephni Posted April 18, 2009 Author 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 Link to comment Share on other sites More sharing options...
Greg2 Posted April 18, 2009 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++'. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now