Linux linking problems

I am planning on creating a game in linux and windows. I am using the borland c++ compiler in windows, which through a lot of trial and eror i have a fine-tuned makefile, which works.
The problem is this. I want to control the entire process using the makefile, including the linking thru the linker. In windows I have found the startup code, and all is good. But what library do I have to link a c++ object to, to create an executable in linux . I can get it to work fine for a c program but it doesn’t work for c++ code.
Does anyone know what libarys I am supposed to link it to??

Originally posted by dmdrummond:
I am planning on creating a game in linux and windows. I am using the borland c++ compiler in windows, which through a lot of trial and eror i have a fine-tuned makefile, which works.
The problem is this. I want to control the entire process using the makefile, including the linking thru the linker. In windows I have found the startup code, and all is good. But what library do I have to link a c++ object to, to create an executable in linux . I can get it to work fine for a c program but it doesn’t work for c++ code.
Does anyone know what libarys I am supposed to link it to??

Why do people post questions like this without providing any detail as to what the real problem is? (Error messages, etc).

Anyways, I’ll put on my clairvoyent hat and assume that the problem is you are linking with either gcc or ld, and you are getting errors like “undefined reference to ostream::cout blah blah blah”. You can solve that either by linking with g++ or by adding -lstdc++ to your link command.

If that isn’t the problem that you’re having, perhaps you’d share some more detail?

Sorry about the vagueness of the whole issue it’s just that I am in college and I don’t have my linux box with me, so I can’t remember the specifics. I am trying, as I previously said to control the whole process with makefiles. I am compiling with g++, but then I am reluctant to let it do all the linking for me. I’d rather know what it was doing, and control everything. I have a debian potato release of linux, and I think all my c++ library paths a messed up as well (this obviously doesn’t help). I’ll try linking with the librarys you recommended me to link with. Thanks for the help.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.