ld: fatal: option -dn and -c are incompatible

Hello,

Could some one help me out how to resolve the following error in Solaris 9?

ld: fatal: option -dn and -c are incompatible

ld: fatal: Flags processing errors

I am using SUNStudio 9 on a sparc machine.

I was getting "ld: fatal: option -dy and -ac are incompatible" error before adding "-Bstatic" to my liker switch. I am building a static binary the and my linker line in make file read like this...

export COMPILER="/opt/SUNWspro/bin/CC"

export TESTEXEBUILDFLAGSRELEASE="-dn -a -staticlib=Crun -static -v -DUNIX -DSOLARIS -I../TESTFiles"

$COMPILER $TESTEXEBUILDFLAGSRELEASE main.cpp -o test -L. -ltest_sunos -L../TESTFiles -ltestclient_sunos -lpam -lrt -lpthread -ldl>> $OUTPUTFILE 2>&1

Any suggestions would be greatly appreciated...

Thanks,

Reddy

[841 byte] By [BHReddy] at [2007-11-26 7:09:46]
# 1

"man ld" should answer most of your questions. In particular, -c creates a configuration file for use at program run time, affecting dynamic linking. But -dn is for use in creating a fully static object -- no dynamic linking. It makes no sense to use both at the same time.

You should not ordinarily link system libraries (like libCrun) statically. If you create a fully static program, it probably will run properly only on an identical computer system.

Do you have a particular requirement to create a fully static program? If not, you should link all system libraries dynamically, which is the default.

clamage45 at 2007-7-6 16:01:02 > top of Java-index,Development Tools,Solaris and Linux Development Tools...