Again linker trouble

qcc aLotOf.o evenMoreOf.o notYetEnoughOf.o -Vgcc_ntox86 -Bstatic -g -l phexlib -l PtWeb -l Ap -l ph -l m -l font -l socket -M -o myApp
C:/Programme/QNX630/target/qnx6/x86/lib/libc.a(tmpnam.o): In function tmpnam': tmpnam.o(.text+0x218): multiple definition of tmpnam’
C:/Programme/QNX630/target/qnx6/x86/lib/libm.a(tmpnam.o)(.text+0x0): first defined here
/cygdrive/c/Programme/QNX630/host/win32/x86/usr/bin/ntox86-ld: Warning: size of symbol `tmpnam’ changed from 163 to 33 in C:/Programme/QNX630/target/qnx6/x86/lib/libc.a(tmpnam.o)

Again this trouble, i had to solve this once and did it with linking to font before socket (or something like this …) but thist time its -l PtWeb giving me the trouble. btw. autogenerated till -l font -l socket by PhAB@Win32

Suggestions?

Das Problem ist wohl, dass sowhol in libph.so als auch in libm.so als auch in libc.so diese Funktion referenziert wird.

Wrong lang again ^^

The problem is, it is referenced in libph,libm and libc … but just troubles libm and libc.

Much more funny, i never used this function ^^

And it does not complain when leaving out -Bstatic

Is it possible to tell the linker to use tmpnam from libc and ignore tmpnam from libm?
I also thought about wrap to my own tmpnam … but that i think would be the latest thing i should do.

I post some more output:
qcc alotof.o evenmore.o about25.o -Vgcc_ntox86 -Bstatic -g -l phexlib -l PtWeb -l Ap -l ph -l m -l font -l socket -Wl,-ytmpnam -M -o laconNto

C:/Programme/QNX630/target/qnx6/x86/usr/lib/libph.a(PpPrint.o): reference to tmpnam
C:/Programme/QNX630/target/qnx6/x86/lib/libm.a(tmpnam.o): definition of tmpnam
C:/Programme/QNX630/target/qnx6/x86/lib/libc.a(tmpnam.o): definition of tmpnam
C:/Programme/QNX630/target/qnx6/x86/lib/libc.a(tmpnam.o): In function tmpnam': tmpnam.o(.text+0x218): multiple definition of tmpnam’
C:/Programme/QNX630/target/qnx6/x86/lib/libm.a(tmpnam.o)(.text+0x0): first defined here
/cygdrive/c/Programme/QNX630/host/win32/x86/usr/bin/ntox86-ld: Warning: size of symbol `tmpnam’ changed from 163 to 33 in C:/Programme/QNX630/target/qnx6/x86/lib/libc.a(tmpnam.o)

This issue has been fixed internally. The easist way to solve this is to simply remove the tmpnam.o object from libm.a

ar dv libm.a tmpnam.o

while you’re at it, remove put putw.o as well! :slight_smile:

Otherwise, I think if you put an extra -lc before the -lm then it will resolve libc from there first.

Regards,

Colin