Problem linking a shared library

James.Ryu@VerizonWireless.com James.Ryu@VerizonWireless.com
Sun Apr 17 04:04:00 GMT 2005


Hi,

I'm kind of new to gcc and am trying to implement JNI for our application
for single signon.  I have so far built the JAVA portion and am currently
trying to create a shared lib file.  It seems that it compiles fine, but has
problems with linking.  This code has been successfully built previously so
I know it probably not the code itself.  Looking at references in the web, I
noticed someone having a similar problem(but without a solution).  Something
related to the gcc using the Solaris linker which has known compatibility
issues.  If this was the case, how do I set gcc to look for the right linker
(gcc linker?) I'm confused because my gcc installation does not seem to have
an 'ld' program in the folders where gcc is installed.  Any pointers would
be greatly apprciated...

gcc -o libnew.so -shared -I/opt/app/SUNWappserver/jdk/include libold.so
JNIAdapter.c -static -lc -v

This returns me the following error:

Reading specs from /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.0/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as
--with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.4.0
 /usr/local/libexec/gcc/sparc-sun-solaris2.8/3.4.0/cc1 -quiet -v
-I/opt/app/SUNWappserver/jdk/include JNIAdapter.c -quiet -dumpbase
JNIAdapter.c -mcpu=v7 -auxbase JNIAdapter -version -o /vas
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory
"/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.0/../../../../sparc-sun-solaris
2.8/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/app/SUNWappserver/jdk/include
 /usr/local/include
 /usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.0/include
 /usr/include
End of search list.
GNU C version 3.4.0 (sparc-sun-solaris2.8)
        compiled by GNU C version 3.4.0.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
 /usr/ccs/bin/as -V -Qy -s -xarch=v8 -o /var/tmp//ccS3p9sv.o
/var/tmp//ccb4M44v.s
/usr/ccs/bin/as: Sun WorkShop 6 2003/12/18 Compiler Common 6.0 Patch
114802-02
 /usr/local/libexec/gcc/sparc-sun-solaris2.8/3.4.0/collect2 -V -dn -Bstatic
-G -dy -z text -Y P,/usr/ccs/lib:/usr/lib -Qy -o libnew.so
/usr/local/lib/gcc/sparc-sun-solaris2.8/3.4.0/crti.o /o
ld: Software Generation Utilities - Solaris Link Editors: 5.8-1.291
ld: warning: option -d appears more than once, first setting taken
ld: fatal: option -dn and -z[text|textwarn|textoff] are incompatible
ld: fatal: option -dn and -G are incompatible
ld: fatal: Flags processing errors
collect2: ld returned 1 exit status


                            
 James Ryu
 * Email: james.ryu@verizonwireless.com
___________________________________________________________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure.  If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof.  Thank you.



More information about the Gcc-help mailing list