This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Linking with g++ under AIX


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
      <decl.'s>
      extern int rand_r();
      <more decl.'s>
   #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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]