By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,190 Members | 1,653 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,190 IT Pros & Developers. It's quick & easy.

Linker Error: For a defined method in C++

P: n/a
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: .RateDetailRec::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.

Jan 11 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Sorry, the error message is as shown below:
ld: 0711-317 ERROR: Undefined symbol: .RateRec::getPeriodSize() const

Jan 11 '06 #2

P: n/a
nk******@gmail.com writes:
I defined a simple method, getRecsize() inside one of the classes,
Class RateRec as shown below.


comp.lang.c++ is down the hall, on the left, just past the water
cooler. Around here, C++ merely increments the value of C and yields
the previous unincremented value.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
Jan 11 '06 #3

P: n/a
nk******@gmail.com wrote:
Hi,

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

class RateRec
{
public:

[etc.]

You want news:comp.lang.c++, not news:comp.lang.c
C++ and C are different languages
Jan 11 '06 #4

P: n/a
nk******@gmail.com wrote:
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: .RateDetailRec::getPeriodSize()
const


While your problems are no doubt C++, it seems to me that
common sense might give an answer. You say that this is a
problem related to the getRecSize function and give code/etc
for that function. The linker says the problem related to
a different function called getPeriodSize. Hmmm. Perhaps it
is telling you something? But anyway, followups should be
in comp.lang.c++.

-David
Jan 12 '06 #5

P: n/a
nk******@gmail.com wrote:

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

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

.... snip ...

This has nothing to do with the C language. For C++, go out the
door, turn left, go 32 paces and enter the group labelled C++ on
the right.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Jan 12 '06 #6

P: n/a
On 2006-01-11, nk******@gmail.com <nk******@gmail.com> wrote:
Sorry, the error message is as shown below:
ld: 0711-317 ERROR: Undefined symbol: .RateRec::getPeriodSize() const

Please quote.

--
Ioan - Ciprian Tandau
tandau _at_ freeshell _dot_ org (hope it's not too late)
(... and that it still works...)
Jan 12 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.