dynamic linking with c++

Wanner Vinicius Fagundes Lima wanner@comp.ufla.br
Wed May 7 18:06:00 GMT 2003


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     |
|--------------------------------|



More information about the Gcc-help mailing list