Jump to content

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...