From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ford, Mark (MFORD)" To: "'gcc-help@gcc.gnu.org'" Subject: Linking with g++ under AIX Date: Wed, 29 Dec 1999 07:38:00 -0000 Message-id: <09328AED5429D311A3000008C7911B1001C28E7B@exanpmb1.arinc.com> X-SW-Source: 1999-12/msg00373.html After installing GCC under AIX 4.2.1, I was unable to link functions from IBM's "threadsafe" library (libc_r.a), using g++ (strangely gcc seems to link fine). Turns out, the problem is that, in stdlib.h, some functions were #ifdef'ed out, like this: #ifdef _THREAD_SAFE extern int rand_r(); #endif As a quick workaround, I added "-D_THREAD_SAFE to my compile and link commands. But, I'm still looking for a compiler switch to turn on this macro. Does GCC support threads? And, if so, is there a compiler switch that will turn on this macro, or is this just something that only IBM recognizes? Also, is there some easy way to correlate which macros, if any, are set by which compiler options? From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Ford, Mark (MFORD)" To: "'gcc-help@gcc.gnu.org'" Subject: Linking with g++ under AIX Date: Fri, 31 Dec 1999 22:24:00 -0000 Message-ID: <09328AED5429D311A3000008C7911B1001C28E7B@exanpmb1.arinc.com> X-SW-Source: 1999-12n/msg00373.html Message-ID: <19991231222400.zXBjfIM7l7HNkG87GhC7ANU9JBN_kSnsUHC7c6GZRi8@z> After installing GCC under AIX 4.2.1, I was unable to link functions from IBM's "threadsafe" library (libc_r.a), using g++ (strangely gcc seems to link fine). Turns out, the problem is that, in stdlib.h, some functions were #ifdef'ed out, like this: #ifdef _THREAD_SAFE extern int rand_r(); #endif As a quick workaround, I added "-D_THREAD_SAFE to my compile and link commands. But, I'm still looking for a compiler switch to turn on this macro. Does GCC support threads? And, if so, is there a compiler switch that will turn on this macro, or is this just something that only IBM recognizes? Also, is there some easy way to correlate which macros, if any, are set by which compiler options?