From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,923588eedb81efa6,start X-Google-Attributes: gidfee84,public From: padula@sw.stratus.com (John Padula) Subject: C++ linker problems on OSF/1 v3.2 Date: 1996/08/26 Message-ID: <4vspeh$g8q@transfer.stratus.com>#1/1 X-Deja-AN: 176588434 distribution: world organization: Stratus Computer, Inc. newsgroups: comp.unix.osf.osf1 We have defined the following linker directives in one of our makefiles: OPLIBS=-non_shared -lpthreads -lmach -lbsd -ldnet_stub -lc_r -lpthreads -lmach (Don't ask why we have 'pthreads' and 'mach' defined twice, I don't know either!) The problem is that libc ("-lc") is added implictly by the compiler. Both libc and libc_r define _sigprocmask. Using the "-non_shared" directive causes the following linker error: /usr/ccs/lib/libc.a(_sigprocmsk.o): _sigprocmask: multiply defined I know this comes from a conflict in libc and libc_r, as I specified "-y_sigprocmask" as part of the compile flags and I got back: /usr/ccs/lib/libc_r.a(sigprocmask.o): reference to external undefined _sigprocmask /usr/ccs/lib/libc_r.a(_sigprocmsk.o): definition of external text _sigprocmask /usr/ccs/lib/libc.a(setjmp.o): reference to external undefined _sigprocmask /usr/ccs/lib/libc.a(_sigprocmsk.o): definition of external text _sigprocmask ld: /usr/ccs/lib/libc.a(_sigprocmsk.o): _sigprocmask: multiply defined /usr/ccs/lib/libc.a(sigjmp.o): reference to external undefined _sigprocmask /usr/ccs/lib/libc.a(_longjmp_internal.o): reference to external undefined _sigprocmask *** Exit 1 I'm noting that this seems to be more of a c++ problem, as I can create a program in C and C++, use the same makefile, but get no error when I use the cc compiler. Has anyone ever been bit by this? Is this some kind of known problem? My other question is: if I'm stuck using the "-non_shared" directive, can I get around this in any way? As it looks like I'm forced to get libc, I tried removing the libc_r library, but got undefined's on: libc_locks_reinit cma__tis_vector_get_bounds cma__tis_objects_exist ldr_declare_lock_functions Anyone out there have any suggestions on how to resolve this? Regards and TIA, JohnP