473,395 Members | 1,383 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Q: linker error with a missing method

Hi!

I get a mysterious linker error:

undefined reference to `Matrix<float>::operator()(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/ ---]
Jul 22 '05 #1
3 1196
Arne Schmitz wrote:
Hi!

I get a mysterious linker error:

undefined reference to `Matrix<float>::operator()(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.
Jul 22 '05 #2
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/ ---]
Jul 22 '05 #3
Arne Schmitz wrote:
I get a mysterious linker error:

undefined reference to `Matrix<float>::operator()(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?

Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Baloff | last post by:
Hello I have this linker error which makes me think that the definition file is not being seen by the linker, this code is taken from "Thinking in C++, 2nd Edition, Volume 1, Annotated Solutions...
3
by: Grahamo | last post by:
Hi, I have a question that pertains to Templates and link time. This is totally for my own understanding and to correct what's obviously an erroneous view of things on my behalf; Lets say I...
9
by: Peter Oliphant | last post by:
For some reson my code is generating a LNK1215 error, which 'suggests' I re-install VS C++. So I did. which did NOT solve the problem. The weid part is it seems to be caused by my one CPP file, but...
6
by: Sampei120 | last post by:
When I go to compile a project I see this error undefined reference to `_imp___ZN3irr12createDeviceENS_5video13E_DRIVER_TYPEERKNS_4core11dimension2dIiEEjbbbPNS_14IEventReceiverEPKw' someone...
6
by: nkrisraj | last post by:
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; ......
3
by: nkrisraj | last post by:
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; ......
4
by: srini4vasan | last post by:
Hi, I wrote a small socket program in C++ using unix machine. Compiler CC. It is asking some library file or linker file Could you please send the library files or linker files for following...
1
by: Deepath G | last post by:
This is deepath.. I am getting some linker error when i am trying to connect Websphere MQ using Borland C++ Builder 2006 using imqi.hpp on windows. Error Message ----------------------- ...
3
by: Rahul | last post by:
Hi Everyone, I have the following polymorphic classes, class Shape { public : virtual void draw() { } virtual void sample();
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.