- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Building Log4cplus fails with "ld: Unsatisfied...
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
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
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
11-07-2013 12:18 AM
11-07-2013 12:18 AM
Hello,
I'm trying to compile log4cplus on HP-UX (https://code.launchpad.net/~log4cplus/log4cplus/1.1.x)
$ uname -a
HP-UX migs01a B.11.31 U ia64 0841004181 unlimited-user license
$ aCC --version
aCC: HP C/aC++ B3910B A.06.20 [May 13 2008]
Library is compiled just "fine", problem is when it tryes to compile some test program and link created library to it
ld: Unsatisfied symbol "virtual table of loggingserver::ClientThread" in file loggingserver.o
ld: Unsatisfied symbol "virtual table of loggingserver::ClientThread" in file loggingserver.o
I suspect that some warnings along library build might cause this error, but I'm not sure
Attaching build log from jenkins
And btw, on other platforms it compiles OK, even on some realy old AIX
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2013 12:42 AM
11-07-2013 12:42 AM
Re: Building Log4cplus fails with "ld: Unsatisfied symbol virtual table of"
Can you please pass on the pre-processed .i file for loggingserver.cxx using the command line options -E -.i as shown below:
aCC -DHAVE_CONFIG_H -I../include -I../include -DNDEBUG -D_GNU_SOURCE=1 -D_REENTRANT -AA +DD64 -mt -D_REENTRANT -E -.i loggingserver.cxx
HP-UX Compilers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2013 02:59 AM - edited 11-07-2013 03:25 AM
11-07-2013 02:59 AM - edited 11-07-2013 03:25 AM
Re: Building Log4cplus fails with "ld: Unsatisfied symbol virtual table of"
Requested preprocessed file
Edit: actualy attaching the file (had to add extension to be able to attach it)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2013 12:49 PM - edited 11-07-2013 01:18 PM
11-07-2013 12:49 PM - edited 11-07-2013 01:18 PM
Re: Building Log4cplus fails with "ld: Unsatisfied symbol virtual table of"
>ld: Unsatisfied symbol "virtual table of loggingserver::ClientThread"
This means that the source file that defines the first non pure, non inline virtual function in the class loggingserver::ClientThread was not linked into the application.
I.e. if you have virtual functions in a class, they MUST be defined.
You have virtual functions "run" and ~ClientThread. I see the definition of both. But not of start.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2013 02:22 PM - edited 11-07-2013 02:22 PM
11-07-2013 02:22 PM - edited 11-07-2013 02:22 PM
Re: Building Log4cplus fails with "ld: Unsatisfied symbol virtual table of"
Dennis Handly wrote:>ld: Unsatisfied symbol "virtual table of loggingserver::ClientThread"
This means that the source file that defines the first non pure, non inline virtual function in the class loggingserver::ClientThread was not linked into the application.
I.e. if you have virtual functions in a class, they MUST be defined.
You have virtual functions "run" and ~ClientThread. I see the definition of both. But not of start.
The loggingserver is a single source executable. The loggingserver::ClientThread class is wholy defined in the single source. The start() function is inherited from its base class AbstractThread. The same code works on multiple platforms with different compilers. It even works on HP-UX HPPA with aCC with and without +DD64. I have hard time believing that there is anything wrong with the source itself.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2013 11:22 PM
11-07-2013 11:22 PM
Re: Building Log4cplus fails with "ld: Unsatisfied symbol virtual table of"
But it is defined
in src/threads.cxx at line 411
which is then linked into library, which is then linked to that executable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2013 06:36 AM
11-08-2013 06:36 AM
Solution>I have hard time believing that there is anything wrong with the source itself.
Looks like the compiler isn't handling __declspec properly?
Some of the construction subobject vtables aren't generated.
Compile with: ... "-D__declspec(X)="
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2013 06:44 AM
11-08-2013 06:44 AM
Re: Building Log4cplus fails with "ld: Unsatisfied symbol virtual table of"
Dennis Handly wrote:>I have hard time believing that there is anything wrong with the source itself.
Looks like the compiler isn't handling __declspec properly?
Some of the construction subobject vtables aren't generated.
Compile with: ... "-D__declspec(X)="
Well, how would this help? The ClientThread class in question does not use any of it. It is declared and defined wholy in the same TU.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2013 03:48 PM - edited 11-11-2013 09:30 AM
11-08-2013 03:48 PM - edited 11-11-2013 09:30 AM
Re: Building Log4cplus fails with "ld: Unsatisfied symbol virtual table of"
>how would this help? The ClientThread class in question does not use any of it. It is declared and defined wholly in the same TU.
Because it does? ;-)
The construction vtables must reference vtables in the base classes. And it needs to reference AbstractThread::start.
__declspec is confusing the compiler.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2013 11:51 PM - edited 11-11-2013 12:06 AM
11-10-2013 11:51 PM - edited 11-11-2013 12:06 AM
Re: Building Log4cplus fails with "ld: Unsatisfied symbol virtual table of"
syntax error near unexpected token `('
cant define it like that
should I remove exports?
Edit:
altering configure file to always set:
ac_cv_declspec=no
ac_cv__attribute__visibility=no
allowed me to finaly build it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2013 12:06 AM
11-11-2013 12:06 AM
Re: Building Log4cplus fails with "ld: Unsatisfied symbol virtual table of"
Dennis Handly wrote:>how would this help? The ClientThread class in question does not use any of it. It is declared and defined wholly in the same TU.
Because it does? ;-)
The construction vtables must reference vtables in the base classes. And it need to reference AbstractThread::start.
__declspec is confusing the compiler.
I am sorry but "don't do it" is not a helpful answer to this problem. Either it is the code that has some kind of problem. If it is the code, then it should be diagnosed and fixed. Or it is the compiler that is buggy and then it should be diagnosed, acknowledge by HP and fixed. And I do not think this problem is in log4cplus' code. Especially since the same code works with HP-PA HP-UX aCC just fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2013 12:29 AM
11-11-2013 12:29 AM
Re: Building Log4cplus fails with "ld: Unsatisfied symbol virtual table of"
There is definetely problem with those exports
As I mentioned above, if I change either configure or ConfigureChecks.cmake file to not define LOG4CPLUS_DECLSPEC_EXPORT it builds just fine (both autotools and cmake)
Also all the tests pass
So for now, fastest solution for me is to add special if to cmake checker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2013 09:30 AM
11-11-2013 09:30 AM
Re: Building Log4cplus fails with "ld: Unsatisfied symbol virtual table of"
>syntax error near unexpected token `('
Hmm, it worked for me but I put it on the compile line and perhaps you need more levels of quoting?
>I am sorry but "don't do it" is not a helpful answer to this problem.
In this case it was. Pinkerik was able to build the app.
BTY, it took me a long time to figure this out.
>If it is the code, then it should be diagnosed and fixed. Or it is the compiler that is buggy and then it should be diagnosed
I don't disagree. If you have a support contract, please contact the Response Center and file a bug.
>Especially since the same code works with aCC3 just fine.
Because there is minimal support for declspec. If you are dumb, there are less things to go wrong. :-)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-13-2013 12:17 AM
11-13-2013 12:17 AM
Re: Building Log4cplus fails with "ld: Unsatisfied symbol virtual table of"
Workaround was provided, so at least something
Thank you for your help