This is a discussion on gcc/pthreads within the AIX Operating System forums, part of the Unix Operating Systems category; --> Hi, I'm trying to compile a simple program that uses pthreads, on AIX using GCC, and get pthread-related errors. ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I'm trying to compile a simple program that uses pthreads, on AIX using GCC, and get pthread-related errors. AIX gurus, please help. g++ -pthread -c QueueReader.cpp In file included from /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/c++/powerpc-ibm-aix5.2.0.0/bits/gthr-posix.h:37, from /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/c++/powerpc-ibm-aix5.2.0.0/bits/gthr-default.h:33, from /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/c++/powerpc-ibm-aix5.2.0.0/bits/gthr.h:98, from /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/c++/powerpc-ibm-aix5.2.0.0/bits/c++io.h:37, from /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/c++/bits/fpos.h:44, from /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/c++/bits/char_traits.h:46, from /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/include/c++/string:47, from QueueAddress.h:11, from Message.h:11, from QueueReader.h:11, from QueueReader.cpp:8: /usr/include/pthread.h:652: error: `pthread_spinlock_t' was not declared in this scope /usr/include/pthread.h:652: error: parse error before `,' token /usr/include/pthread.h:655: error: `pthread_spinlock_t' was not declared in this scope /usr/include/pthread.h:655: error: parse error before `)' token /usr/include/pthread.h:658: error: `pthread_spinlock_t' was not declared in this scope .... and so on - about 10 or 11 complains. I tried adding -D_POSIX_SOURCE and/or -D_XOPEN_SOURCE=600, no visible effect. AIX 5.3. GCC info: Reading specs from /opt/freeware/lib/gcc-lib/powerpc-ibm-aix5.2.0.0/3.3.2/specs Configured with: ../configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld --disable-nls --enable-languages=c,c++ --prefix=/opt/freeware --enable-threads --enable-version-specific-runtime-libs --host=powerpc-ibm-aix5.2.0.0 Thread model: aix gcc version 3.3.2 The program compiles fine with xlC, without any additional options. Any help is greatly appreciated. Bogdan |
| ||||
| I've never gotten past this one on 5.2 when I was trying to compile bacula client and server binaries, but this is mostly to the fact I'm not really a programmer in any way. But as far as I understood and remember it, You don't want to use -pthread but some other thread library. It's been too long ago, look if there is something like an -aixthread option. |