Q: linker error with a missing method

Discussion in 'C++' started by Arne Schmitz, Apr 16, 2004.

  1. Arne Schmitz

    Arne Schmitz Guest

    Hi!

    I get a mysterious linker error:

    undefined reference to `Matrix<float>::eek: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/ ---]
    Arne Schmitz, Apr 16, 2004
    #1
    1. Advertising

  2. Arne Schmitz wrote:

    > Hi!
    >
    > I get a mysterious linker error:
    >
    > undefined reference to `Matrix<float>::eek: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-lite/how-to-post.html#faq-5.8
    http://www.parashift.com/c -faq-lite/containers-and-templates.html#faq-34.14

    -Kevin
    --
    My email address is valid, but changes periodically.
    To contact me please use the address from a recent posting.
    Kevin Goodsell, Apr 16, 2004
    #2
    1. Advertising

  3. Arne Schmitz

    Arne Schmitz Guest

    Arne Schmitz, Apr 16, 2004
    #3
  4. Arne Schmitz wrote:

    > I get a mysterious linker error:
    >
    > undefined reference to `Matrix<float>::eek: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?
    E. Robert Tisdale, Apr 16, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    6
    Views:
    347
  2. Replies:
    3
    Views:
    317
    Pete Becker
    Jan 11, 2006
  3. quad
    Replies:
    3
    Views:
    2,332
    =?ISO-8859-1?Q?Erik_Wikstr=F6m?=
    Jun 9, 2007
  4. Replies:
    0
    Views:
    79
  5. Didier Prophete
    Replies:
    6
    Views:
    191
    Gene Tani
    Jan 20, 2006
Loading...

Share This Page