|
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
I compile the program below on Max OSX with_______________________________________________
GCC version 1151, based on gcc version 3.1 20020420
g++ foo.cpp
ld: Undefined symbols: <-- ERROR
vtable for Foo
Any idea why?
Yes, Foo needs a vtable. Why isn't one created for it?
What must I do to get it created?
-r
**************** contents of foo.cpp **********
class Foo {
protected:
void setit(int);
public:
virtual void bar(); // only a subclass implements
};
class Bird : public Foo {
public:
void bar();
};
// ################
int a;
void Foo::setit(int i) {
a = i;
}
void Bird::bar() {
Foo::setit(8);
}
int main(int argc, char **argv) {
Bird *b = new Bird();
b->bar();
}
// end
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.
| Home | Archives | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2011 Apple Inc. All rights reserved.