Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
ld errors
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Brendan Bond  
View profile  
 More options Dec 20 2003, 2:02 pm
Newsgroups: gnu.gcc.help
From: Brendan Bond <bren...@austin.rr.com>
Date: Sat, 20 Dec 2003 19:02:24 GMT
Local: Sat, Dec 20 2003 2:02 pm
Subject: ld errors
I just have a few questions about gcc's linker, ld: if I have multiple c++
files, (say "class.cc, class.h, and main.cc), and all #include directives
are in their proper places, is there anything I need to do besides "g++
main.cc"? With a container class that I made for a class assignment,
here's the linker output I got:
-----------------------------------
/tmp/ccP5jlPc.o(.text+0x19): In function `main':
: undefined reference to `mycontainer::mycontainer[in-charge]()'
/tmp/ccP5jlPc.o(.text+0x48): In function `main':
: undefined reference to `mycontainer::add(int)'
/tmp/ccP5jlPc.o(.text+0x73): In function `main':
: undefined reference to `mycontainer::~mycontainer [in-charge]()'
/tmp/ccP5jlPc.o(.text+0x8a): In function `main':
: undefined reference to `mycontainer::~mycontainer [in-charge]()'
collect2: ld returned 1 exit status
-----------------------------------
Thanks!

-Brendan Bond <brend...@austin.rr.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Pluzhnikov  
View profile  
 More options Dec 20 2003, 2:10 pm
Newsgroups: gnu.gcc.help
From: Paul Pluzhnikov <ppluzhnikov-...@charter.net>
Date: 20 Dec 2003 11:10:46 -0800
Local: Sat, Dec 20 2003 2:10 pm
Subject: Re: ld errors

Brendan Bond <bren...@austin.rr.com> writes:
> I just have a few questions about gcc's linker, ld: if I have multiple c++
> files, (say "class.cc, class.h, and main.cc), and all #include directives
> are in their proper places, is there anything I need to do besides "g++
> main.cc"?

Yes: "g++ main.cc class.cc"

> With a container class that I made for a class assignment,
> here's the linker output I got:
> -----------------------------------
> /tmp/ccP5jlPc.o(.text+0x19): In function `main':
> : undefined reference to `mycontainer::mycontainer[in-charge]()'

Naturally: since you didn't link in class.o, all of mycontainer
methods defined in class.cc came out unresolved.

Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »