Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Creating simple shared library using gcc under Solaris 10

858675Apr 29 2011 — edited Apr 29 2011
Hi 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 27 2011
Added on Apr 29 2011
1 comment
347 views