Using g++ as a linker

F

Fugitif

Hi !
I'm trying to compile a project using a generic rule that compiles a .cpp to
a .o . To get the resulting program, I try to do the following:
g++ obj1.o obj2.o obj3.o -o program

But it seems that the dependency between the .o cannot be resolved: I get
"undefined reference" errors.

I've read the FAQs, but all the linker error are linked with "virtual" or
mixing C/C++.

If you have any advice, please tell me. Don't hesitate to give me links to
other project doing similar things.

Thanks.

Julien
 
E

E. Robert Tisdale

Fugitif said:
I'm trying to compile a project using a generic rule that compiles a .cpp to
a .o . To get the resulting program, I try to do the following:
g++ obj1.o obj2.o obj3.o -o program

But it seems that the dependency between the .o cannot be resolved: I get
"undefined reference" errors.

I've read the FAQs, but all the linker error are linked with "virtual" or
mixing C/C++.

If you have any advice, please tell me. Don't hesitate to give me links to
other project doing similar things.

Hi Julien,

We would be happy to answer this question
if you would just post it to the gnu.g++.help newsgroup.
 
R

Ron Natalie

Fugitif said:
I've read the FAQs, but all the linker error are linked with "virtual" or
mixing C/C++.

Not enough information, can you create a very small program that demonstrates the
problem. Most likely you haven't consistantly declared the "C" linkage etc...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,148
Messages
2,570,834
Members
47,380
Latest member
AlinaBlevi

Latest Threads

Top