Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old January 11th, 2006, 10:15 PM
nkrisraj@gmail.com
Guest
 
Posts: n/a
Default Linker Error: For a defined method() in C++

Hi,

I defined a simple method, getRecsize() inside one of the classes,
Class RateRec as shown below.

class RateRec
{
public:
size_t getRecSize(void) const;
......

private:
......

};

size_t RateRec::getRecSize(void) const
{
return( periods->size );

}

In this calls, I recently added a new method also. After these,
chnages, Iam able to compile this class correctly. And Iam able to
generate the library, libRateInfo.a, for some of the classes, in which
RateRec is also one of the classes.

I have some other main program. When I trying to link libRateInfo.a to
my main program, Iam getting the linker error related to getRecSize()
function as shown below.

ld: 0711-317 ERROR: Undefined symbol: .RateRec::getPeriodSize()
const

For me, this is a real crazy thing.
I was able to link this library before lot of times. That time, I
didn't get any linker error.

But now, Iam getting this linker error. Any hekp would be greatly
appreciated.

  #2  
Old January 11th, 2006, 10:35 PM
Victor Bazarov
Guest
 
Posts: n/a
Default Re: Linker Error: For a defined method() in C++

nkrisraj@gmail.com wrote:[color=blue]
> [..]
> When I trying to link libRateInfo.a to
> my main program, Iam getting the linker error related to getRecSize()
> function as shown below.
>
> ld: 0711-317 ERROR: Undefined symbol: .RateRec::getPeriodSize()
> const
>
> For me, this is a real crazy thing.
> I was able to link this library before lot of times. That time, I
> didn't get any linker error.
>
> But now, Iam getting this linker error. Any hekp would be greatly
> appreciated.[/color]

Use some system-specific utility to verify that your library does in fact
contain the symbol you're trying to obtain from it. Beyond that, linking
and libraries are compiler- and platform-specific, and off-topic here.

V
  #3  
Old January 11th, 2006, 10:45 PM
Luke Meyers
Guest
 
Posts: n/a
Default Re: Linker Error: For a defined method() in C++

nkrisraj@gmail.com wrote:[color=blue]
> Hi,
>
> I defined a simple method, getRecsize() inside one of the classes,
> Class RateRec as shown below.
>
> class RateRec
> {
> public:
> size_t getRecSize(void) const;
> ......
>
> private:
> ......
>
> };
>
> size_t RateRec::getRecSize(void) const
> {
> return( periods->size );
>
> }
>
> In this calls, I recently added a new method also. After these,
> chnages, Iam able to compile this class correctly. And Iam able to
> generate the library, libRateInfo.a, for some of the classes, in which
> RateRec is also one of the classes.
>
> I have some other main program. When I trying to link libRateInfo.a to
> my main program, Iam getting the linker error related to getRecSize()
> function as shown below.
>
> ld: 0711-317 ERROR: Undefined symbol: .RateRec::getPeriodSize()
> const[/color]

getPeriodSize? Did you define that, in addition to getRecSize? If
not, the solution is fairly obvious.

Luke

  #4  
Old January 11th, 2006, 10:45 PM
Pete Becker
Guest
 
Posts: n/a
Default Re: Linker Error: For a defined method() in C++

nkrisraj@gmail.com wrote:[color=blue]
>
> I have some other main program. When I trying to link libRateInfo.a to
> my main program, Iam getting the linker error related to getRecSize()
> function as shown below.
>
> ld: 0711-317 ERROR: Undefined symbol: .RateRec::getPeriodSize()
> const
>[/color]

Be careful: the error is about RateRec::getPeriodSize, not about
RateRec::getRecSize.

--

Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles