Creating simple shared library using gcc under Solaris 10
858675Apr 29 2011 — edited Apr 29 2011Hi All:
I apologize if this is too newbie a question but have seen nothing that works for me yet.
I'm trying to create a shared library that contains a single object file using gcc (as installed on Solaris 10). I compiled the source code as follows:
gcc -c -fPIC x.cpp -o x.o
and got the x.o object file created and readable.
I then tried (from sample code on line):
gcc -shared -Wl,-soname,libMyLib.so.1 -o libMyLib.so.1.0.1 x.o
and get the following errors:
ld: warning: option -o appears more than once, first setting taken
ld: fatal: file libMyLib.so.1: open failed: No such file or directory
ld: fatal: File processing errors. No output written to x.o
collect2: ld returned 1 exit status