This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]