[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Linker problem ved brug af egen so fil



Jeg forsøger at lave mit eget shared lib. fil (.so), og det er også til
dels lykkes. Jeg har fået det compileret, og fået det linket.

gcc -D_LINUX_ -D_ISOC99_SOURCE -fPIC -Wall -g -c libmylib.cpp
gcc -g -shared -W1,-soname,libmylib.so.0 -o libmylib.so.0.0 libmylib.o
-lc
ln -sf libmylib.so.0.0 libmylib.so.0
ln -sf libmylib.so.0 libmylib.so

For at teste det af, har jeg så lavet et lille test program, som så skal
linkes sammen med .so filen. Her for jeg dog et par fejl, og jeg fatter
det ikke.

gcc -D_LINUX_ -D_ISOC99_SOURCE -Wall -g -c test.c -o test.o

og så:

gcc -D_LINUX_ -D_ISOC99_SOURCE -g -o test test.o -L. -lmylib

./libmylib.so: undefined reference to `pthread_create'
./libmylib.so: undefined reference to `pthread_cancel'
./libmylib.so: undefined reference to `Tcl_Sleep'
collect2: ld returned 1 exit status

Jeg bruger andre funktioner fra pthread.h og dem kommer der ingen fejl
på.

Hvad kan der være galt ??

mvh
Kasper



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *