Unix Technical Forum

gcc/pthreads

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. ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-05-2008, 07:14 AM
sheptunov@yahoo.com
 
Posts: n/a
Default gcc/pthreads

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-05-2008, 07:15 AM
florian.heigl@gmail.com
 
Posts: n/a
Default Re: gcc/pthreads

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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 01:08 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com