Using g++ as a linker

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fugitif

    Using g++ as a linker

    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. Robert Tisdale

    #2
    Off Topic: Using g++ as a linker

    Fugitif wrote:[color=blue]
    >
    > 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.[/color]

    Hi Julien,

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

    Comment

    • Ron Natalie

      #3
      Re: Using g++ as a linker


      "Fugitif" <fugitif(@)alte rn.org> wrote in message news:3fbd5171$0 $17099$626a54ce @news.free.fr.. .
      [color=blue]
      >
      > I've read the FAQs, but all the linker error are linked with "virtual" or
      > mixing C/C++.[/color]

      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...


      Comment

      Working...