This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Linking with g++ under AIX
- To: "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Subject: Linking with g++ under AIX
- From: "Ford, Mark (MFORD)" <MFORD at arinc dot com>
- Date: Wed, 29 Dec 1999 10:37:21 -0500
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?