Shared library creation ...... Problem... Plz Help..
Hi all,
I have written two small programs as I have mentioned below.. ================================== util1.c --------------------------------------- int util1(char *str) { printf("1. %s\n"); return 0; } --------------------------------------- util2.c --------------------------------------- int util2(char *str) { printf("2. %s\n"); return 0; } --------------------------------------- ================================== And I compiled above two file : $ : gcc -fPIC -c util1.c $ : gcc -fPIC -c util2.c Now when i tryed to create shared library using following command : $ : gcc -shared libmyutil.so util1.o util2.o =================================== main problem.......... here ----------------------------------------------- I got the following message : libmyutil.so : no such file or directory =================================== Plz tell me how to create the Shared library.............. With regard Rajesh. |
-lmyutil should work.
Look below for a more comprehensive answer. http://crasseux.com/books/ctutorial/...a-library.html |
Re: Shared library creation ...... Problem... Plz Help..
Quote:
So it must be: Code:
gcc -shared -o libmyutil.so util1.o util2.o |
All times are GMT -5. The time now is 10:19 PM. |