ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2011/12/26/01:30:09

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: jimm <jmichae3 AT yahoo DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: pthreads compilation error
Date: Sun, 25 Dec 2011 22:10:08 -0800 (PST)
Organization: http://groups.google.com
Lines: 94
Message-ID: <032816da-42c9-45e7-87f2-516da6fd7455@q8g2000yqa.googlegroups.com>
NNTP-Posting-Host: 24.22.56.37
Mime-Version: 1.0
X-Trace: posting.google.com 1324880236 702 127.0.0.1 (26 Dec 2011 06:17:16 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Mon, 26 Dec 2011 06:17:16 +0000 (UTC)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: q8g2000yqa.googlegroups.com; posting-host=24.22.56.37; posting-account=05hOMwoAAAB6R8xtiQKzEljSMzgOhVF1
User-Agent: G2/1.0
X-Google-Web-Client: true
X-Google-Header-Order: HUALESNKRC
X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1,gzip(gfe)
Bytes: 4530
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Sun 12/25/2011 22:03:40.43|C:\prj\test\djgpp|>gpp -lpth -Wall -W -
Wextra -v -save-temps -s -Map=pthreads.map -oa.exe pthreads.cpp
Using built-in specs.
COLLECT_GCC=c:/djc462~1/bin/gpp.exe
COLLECT_LTO_WRAPPER=c:/djc462~1/bin/../libexec/gcc/djgpp/4.62/lto-
wrapper.exe
Target: djgpp
Configured with: /v203/gcc-4.62/configure djgpp --prefix=/dev/env/
DJDIR --disable-nls --disable-werror --enable-languages=c,c+
+,fortran,objc,obj-c++,ada --enabl
e-libquadmath-support
Thread model: single
gcc version 4.6.2 (GCC)
COLLECT_GCC_OPTIONS='-Wall' '-Wextra' '-v' '-save-temps' '-s' '-
Map=pthreads.map' '-o' 'a.exe' '-mtune=pentium' '-march=pentium'
 c:/djc462~1/bin/../libexec/gcc/djgpp/4.62/cc1plus.exe -E -quiet -v -
iprefix c:/djc462~1/bin/../lib/gcc/djgpp/4.62/ -remap pthreads.cpp -
mtune=pentium -march=pe
ntium -Wall -Wextra -fpch-preprocess -o pthreads.ii
ignoring nonexistent directory "c:/djc462~1/bin/../lib/gcc/djgpp/
4.62/../../../../djgpp/include"
ignoring duplicate directory "c:/djc462~1/bin/../lib/gcc/../../lib/gcc/
djgpp/4.62/../../../../include/cxx/4.62"
ignoring duplicate directory "c:/djc462~1/bin/../lib/gcc/../../lib/gcc/
djgpp/4.62/../../../../include/cxx/4.62/djgpp"
ignoring duplicate directory "c:/djc462~1/bin/../lib/gcc/../../lib/gcc/
djgpp/4.62/../../../../include/cxx/4.62/backward"
ignoring duplicate directory "c:/djc462~1/bin/../lib/gcc/../../lib/gcc/
djgpp/4.62/include"
ignoring duplicate directory "c:/djc462~1/bin/../lib/gcc/../../lib/gcc/
djgpp/4.62/include-fixed"
ignoring nonexistent directory "c:/djc462~1/bin/../lib/gcc/../../lib/
gcc/djgpp/4.62/../../../../djgpp/include"
#include "..." search starts here:
#include <...> search starts here:
 c:/djc462~1/bin/../lib/gcc/djgpp/4.62/../../../../include/cxx/4.62
 c:/djc462~1/bin/../lib/gcc/djgpp/4.62/../../../../include/cxx/4.62/
djgpp
 c:/djc462~1/bin/../lib/gcc/djgpp/4.62/../../../../include/cxx/4.62/
backward
 c:/djc462~1/bin/../lib/gcc/djgpp/4.62/include
 c:/djc462~1/bin/../lib/gcc/djgpp/4.62/include-fixed
 c:/djc462~1/include
End of search list.
In file included from pthreads.cpp:1:0:
c:/djc462~1/include/pthread.h:113:53: fatal error: sys/socket.h: No
such file or directory (ENOENT)
compilation terminated.

Sun 12/25/2011 22:05:23.65|C:\prj\test\djgpp|>

source code is an example from https://computing.llnl.gov/tutorials/pthreads/#Abstract

#include <pthread.h> //in djgpp it's pthread.h, not pthreads.h like in
the example.
#include <stdio.h>
#define NUM_THREADS     5

void *PrintHello(void *threadid)
{
   long tid;
   tid = (long)threadid;
   printf("Hello World! It's me, thread #%ld!\n", tid);
   pthread_exit(NULL);
}

int main (int argc, char *argv[])
{
   pthread_t threads[NUM_THREADS];
   int rc;
   long t;
   for(t=0; t<NUM_THREADS; t++){
      printf("In main: creating thread %ld\n", t);
      rc = pthread_create(&threads[t], NULL, PrintHello, (void *)t);
      if (rc){
         printf("ERROR; return code from pthread_create() is %d\n",
rc);
         exit(-1);
      }
   }

   /* Last thing that main() should do */
   pthread_exit(NULL);
}


I extracted pth*.zip

1. & 2. djgpp does not like the standard gcc compiler switch -XLinker
or the standard -pthreads which is supposed to be used with
pthreads.
3. I didn't look at the standard, but I think the header is supposed
to be called pthreads.h, not pthread.h, and pthreads.h is an 8.3
filename.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019