3.0.3 on hppa2.0w-hp-hpux11.00 needs & can't find the pthread lib for its own consumption

JDonner jdonner0@earthlink.net
Fri Jan 11 16:41:00 GMT 2002


   Hi,

     When I compile a simple non-threaded hello world, foo.cpp,
   the compiler complains about several pthread symbols missing,
   meaning gcc's libs got built without it, or gcc is failing to
   quietly link pthreads in, when it needs them for itself.
   Does anyone know how to get the pthread lib linked in?

   Thanks,

   Jeff


abuharal@upsapps-~>cat foo.cpp
#include <iostream>

int main()
{
   std::cout << "Hello" << std::endl;
}
abuharal@upsapps-~>g++ foo.cpp
/usr/ccs/bin/ld: Unsatisfied symbols:
    pthread_once (code)
    pthread_key_create (code)
    pthread_setspecific (code)
    pthread_mutex_unlock (code)
    pthread_getspecific (code)
    pthread_mutex_lock (code)
collect2: ld returned 1 exit status


   I built it as:


abuharal@upsapps-~>g++ -v
Reading specs from 
/usr/local/gcc303/lib/gcc-lib/hppa2.0w-hp-hpux11.00/3.0.3/specs
Configured with: ../gcc-3.0.3/configure --prefix=/usr/local/gcc303 
--with-gnu-as --with-as=/usr/local/bin/as --with-ld=/usr/ccs/bin/ld 
--enable-threads=posix
Thread model: posix
gcc version 3.0.3


   Incidentally with warnings turned on it gives lots of warnings like:


/usr/local/gcc303/include/g++-v3/bits/stl_alloc.h:523: warning: 
aggregate has a partly bracketed initializer



More information about the Gcc-help mailing list