Thread: error with function

  1. #16
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    search for functions declarations under osg::Object that look something like:

    return_type function_name(arg_list) = 0;

    Then do the same for the class BMLDrawable.

    Is this your code?

    Anyways, those are pure virtual functions. The existence of a single one means you cannot create objects from that class. They exist mainly to provide abstract classes functionality. The thing is that classes derived from an abstract class have to define those functions. Otherwise they will be abstract classes themselves.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  2. #17
    Registered User
    Join Date
    Jul 2006
    Location
    Kingston, Ontario
    Posts
    12
    ok i dont seem to see any function declarations with that sort of format. And no, this isn't my code, I'm just trying to change a few things with my minimal c++ knowledge. The only thing I wrote was the GetMarkerCount function that I posted at the beginning. so what can i do now that i've found out there are no pure virtual functions?

  3. #18
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    There has to be a pure virtual function somewhere in the hierarchy. Either osg::Drawable, or one of its base classes, or one of its base classes' base classes, etc. has a function with the = 0 at the end that has not been implemented higher up in the hierarchy. You have to find that function and implement it in BMLDrawable.

    Maybe its the destructor and you just need to add empty braces?

  4. #19
    Registered User
    Join Date
    Jul 2006
    Location
    Kingston, Ontario
    Posts
    12
    ok I found this in osg:: Drawable:

    Code:
            /** draw directly ignoring an OpenGL display list which could be attached.
              * This is the internal draw method which does the drawing itself,
              * and is the method to override when deriving from Drawable.
              */
            virtual void drawImplementation(State& state) const = 0;
    now how do I implement it in BMLDrawable?

  5. #20
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    That's for you to figure out based on what your classes and program are supposed to do. If you just want to get it to compile so you can test your other function, you can copy that declaration into your BMLDrawable class and replace = 0 with empty curly braces.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 03:06 PM
  3. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  4. Replies: 28
    Last Post: 07-16-2006, 11:35 PM
  5. const at the end of a sub routine?
    By Kleid-0 in forum C++ Programming
    Replies: 14
    Last Post: 10-23-2005, 06:44 PM