- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- compiler have some problems with virtual functions
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2006 04:49 PM
10-04-2006 04:49 PM
compiler have some problems with virtual functions
I am having big problems getting the final binary to link...
it seems to me that it is the compiler have some problems with virtual functions. If you look at the following small example to trigger the problem:
# /opt/aCC/bin/aCC -V
aCC: HP ANSI C++ B3910B A.03.55
#cat test.cc
class Foo
{
public:
virtual ~Foo();
Foo() {};
virtual void clear();
};
class Bar : public Foo
{
public:
virtual ~Bar() {};
Bar() : Foo() {};
virtual void clear() {
Foo::clear();
};
};
# aCC -c test.cc
# nm -u test.o
Undefined symbols from test.o:
typeid
Foo::~Foo()
Foo::clear()
Class tables [Vtable] dependent on key function: "__versioned_type_info::~__versioned_type_info()"
But if we compare this with other compilers we get:
# /opt/hp-gcc/bin/g++ -c test.cc
[tn202803@lit01:api] nm -u test.o
nm: test.o: no symbols
Please guide me through the issue.
Thanks in advance.
Varun
- Tags:
- virtual function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2006 08:05 PM - edited 10-29-2011 01:38 AM
10-04-2006 08:05 PM - edited 10-29-2011 01:38 AM
Re: compiler has some problems with unsat virtual functions
Why do you think your small example matches your application?
Your small example is illegal. The C++ Standard says 10.3(8), that if you declare a virtual function you must define it.
Therefore you must not use .h files where you never define virtual functions. You must define Foo::~Foo() & Foo::clear().
aCC6 has been enhanced to realize nothing is needed. aCC3 is stuck in a chicken and egg loop.