This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
dynamic linking with c++
- From: Wanner Vinicius Fagundes Lima <wanner at comp dot ufla dot br>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 7 May 2003 15:26:04 -0300 (BRT)
- Subject: dynamic linking with c++
Hi peaple!
I have to do a PAM module, so I need to make a dynamic linking library
with ld. I've tried it with C/C++ code and compilling with g++ with this
commands:
g++ -fPIC -c mymodule.cpp
ld -x --share mymodule.o -o mymodule.so
No erro is reported and the mymodule.so file is created. But when I try
using the module with a PAM application I got a log message like this:
unable to resolve symbol pam_sm_authenticate.
The same code compiling with gcc:
gcc -fPIC -c mymodule.c
ld -x --share mymodule.o -o mymodule.so
works out perfectly.
I'd like to do my module with C++. Do I need to do any thing special to
use C++ and make a dynamic linking library?
Thanks,
Wanner.
Federal University of Lavras - Brazil
--
|--------------------------------|
| Wanner Vinicius Fagundes Lima |
| Ciencia da Computacao - UFLA |
| Linux User # 227651 |
| ICQ # 14495104 |
| www.comp.ufla.br/~wanner |
|--------------------------------|