Problems with gcc3+ on Solaris 5.9

Michael gatford
Fri Mar 10 09:28:00 GMT 2006


I have a C++ cgi search application (semaphoreserver) that links against 
a static library, that I build. The source code for this static library 
consists of some C++ code (.cc extension) and some C files (.c) 
extension. When I initially compiled the static library I got an error 
relating to gxx_personality_v0. I managed to overcome this by linking 
with -lstdc++.

However, when I run the cgi program the webserver logs report the error /usr/local/apache2/cgi-bin/semaphoreserver: fatal: open failed: No such file or directory

The webserver runs as user nobody and has no environment. I can overcome 
this problem by using the Apache SetEnv directive in httpd.conf to set 
LD_LIBRARY_PATH. However, I cannot guarantee that all webservers the 
application runs on will either be configured this way, or even that the 
shared library* will exist on the machine.

Two questions, therefore.

1) Can I overcome the initial error (gxx_personality...) in another way 
(e.g. is there a compiler flag I can set) so that I don't have to link 
against the shared library

2) If the answer to (1) is no (or even if it's yes), is there a way in 
which I can link against a shared library so that it is in fact 
statically linked and thus not need at runtime?

Thanks in advance.

Michael Gatford
APR Smartlogik Support
APR Smartlogik Limited.
Rustat House - Clifton Road - Cambridge - CB1 7EJ
phone +44 (0)1223 27 1025
fax   +44 (0)1223 27 1010

This e-mail may contain proprietary and confidential
information and is intended for the recipient(s) only.
If an addressing or transmission error has misdirected this
e-mail, please notify the systems administrator by forwarding
this e-mail to
If you are not the intended recipient(s) disclosure, distribution,
copying or printing of this e-mail is strictly prohibited.

More information about the Gcc-help mailing list