Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Q: linker error with a missing method

Reply
Thread Tools

Q: linker error with a missing method

 
 
Arne Schmitz
Guest
Posts: n/a
 
      04-16-2004
Hi!

I get a mysterious linker error:

undefined reference to `Matrix<float>:perator()(unsigned, unsigned)'

And I do not know why. I've got the following two operators defined and
declared:

T& operator()(size_t x, size_t y);
T operator()(size_t x, size_t y) const;

The library also gets linked to the executable, but the linking fails
anyway. Why? I thought size_t and unsigned are synonymous?

In my program code I use something like this:

Matrix<float> m; ...
m(i,j) = 1.0f;

Any ideas?

Arne

--
[--- PGP key FD05BED7 --- http://www.root42.de/ ---]
 
Reply With Quote
 
 
 
 
Kevin Goodsell
Guest
Posts: n/a
 
      04-16-2004
Arne Schmitz wrote:

> Hi!
>
> I get a mysterious linker error:
>
> undefined reference to `Matrix<float>:perator()(unsigned, unsigned)'
>
> And I do not know why. I've got the following two operators defined and
> declared:
>
> T& operator()(size_t x, size_t y);
> T operator()(size_t x, size_t y) const;
>
> The library also gets linked to the executable, but the linking fails
> anyway. Why? I thought size_t and unsigned are synonymous?
>
> In my program code I use something like this:
>
> Matrix<float> m; ...
> m(i,j) = 1.0f;
>
> Any ideas?
>


The following FAQs might be relevant:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.8
http://www.parashift.com/c++-faq-lit...html#faq-34.14

-Kevin
--
My email address is valid, but changes periodically.
To contact me please use the address from a recent posting.
 
Reply With Quote
 
 
 
 
Arne Schmitz
Guest
Posts: n/a
 
      04-16-2004
Kevin Goodsell schrieb:

> The following FAQs might be relevant:
>
> http://www.parashift.com/c++-faq-lit...t.html#faq-5.8
>

http://www.parashift.com/c++-faq-lit...html#faq-34.14
>


Thank you. I should've checked the FAQ first, I see... didn't know it
existed though. I'll also try to conform to the posting guidelines next
time.

Thanks again,

Arne

--
[--- PGP key FD05BED7 --- http://www.root42.de/ ---]
 
Reply With Quote
 
E. Robert Tisdale
Guest
Posts: n/a
 
      04-16-2004
Arne Schmitz wrote:

> I get a mysterious linker error:
>
> undefined reference to `Matrix<float>:perator()(unsigned, unsigned)'
>
> And I do not know why.
> I've got the following two operators defined and declared:
>
> T& operator()(size_t x, size_t y);
> T operator()(size_t x, size_t y) const;
>
> The library also gets linked to the executable,
> but the linking fails anyway.
> Why? I thought size_t and unsigned are synonymous?


Evidently, Your compiler thinks so too.

> In my program code I use something like this:
>
> Matrix<float> m; ...
> m(i,j) = 1.0f;
>
> Any ideas?


I assume that templates exist somewhere for these operators.
But were they actually instantiated somewhere?

 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linker error - CVTRES : fatal error CVT1100: quad C++ 3 06-08-2007 11:02 PM
invalid_arity method similar to method missing ? Didier Prophete Ruby 6 01-20-2006 02:35 PM
invalid_arity method similar to method missing ? didier.prophete@gmail.com Ruby 0 01-16-2006 07:39 PM
Linker Error: For a defined method in C++ nkrisraj@gmail.com C Programming 6 01-12-2006 02:27 PM
Linker Error: For a defined method() in C++ nkrisraj@gmail.com C++ 3 01-11-2006 10:31 PM



Advertisments