inline functions

Discussion in 'C++' started by Robin Forster, Jun 29, 2003.

  1. I am trying to turn some of my methods inline. However, the compiler
    complains upon link that the symbols do not exist. I implemented the
    method as shown below:

    inline void aule_gl_surface::gl_bind(int frame) { code; }

    Cheers!
     
    Robin Forster, Jun 29, 2003
    #1
    1. Advertising

  2. "Robin Forster" <> wrote...
    > I am trying to turn some of my methods inline. However, the compiler
    > complains upon link that the symbols do not exist. I implemented the
    > method as shown below:
    >
    > inline void aule_gl_surface::gl_bind(int frame) { code; }


    Inlined functions have to be visible to the compiler when it
    compiles calls to them. Move all functions you want to turn
    "inline" to the header next to 'aule_gl_surface' definition.

    Victor
     
    Victor Bazarov, Jun 29, 2003
    #2
    1. Advertising

  3. Robin Forster

    Rolf Magnus Guest

    Victor Bazarov wrote:

    > "Robin Forster" <> wrote...
    >> I am trying to turn some of my methods inline. However, the compiler
    >> complains upon link that the symbols do not exist. I implemented the
    >> method as shown below:
    >>
    >> inline void aule_gl_surface::gl_bind(int frame) { code; }

    >
    > Inlined functions have to be visible to the compiler when it
    > compiles calls to them. Move all functions you want to turn
    > "inline" to the header next to 'aule_gl_surface' definition.


    You can also put them in an own file if you want, and then #include that
    at the end of the header.
     
    Rolf Magnus, Jun 29, 2003
    #3
    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. Abhi
    Replies:
    2
    Views:
    759
    E. Robert Tisdale
    Jul 3, 2003
  2. Replies:
    3
    Views:
    483
  3. Daniel Vallstrom
    Replies:
    2
    Views:
    2,005
    Kevin Bracey
    Nov 21, 2003
  4. jamihuq

    converting inline functions to C functions

    jamihuq, May 16, 2006, in forum: C Programming
    Replies:
    7
    Views:
    362
  5. Rahul
    Replies:
    3
    Views:
    471
    James Kanze
    Feb 28, 2008
Loading...

Share This Page