Mail Archives: djgpp/2011/12/26/02:45:24
X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f
|
From: | Rugxulo <rugxulo AT gmail DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Re: pthreads compilation error
|
Date: | Sun, 25 Dec 2011 23:23:34 -0800 (PST)
|
Organization: | http://groups.google.com
|
Lines: | 75
|
Message-ID: | <ec7c6ee3-d02d-4fa2-b379-ff9781164f58@q9g2000yqe.googlegroups.com>
|
References: | <032816da-42c9-45e7-87f2-516da6fd7455 AT q8g2000yqa DOT googlegroups DOT com>
|
NNTP-Posting-Host: | 65.13.115.246
|
Mime-Version: | 1.0
|
X-Trace: | posting.google.com 1324884215 8560 127.0.0.1 (26 Dec 2011 07:23:35 GMT)
|
X-Complaints-To: | groups-abuse AT google DOT com
|
NNTP-Posting-Date: | Mon, 26 Dec 2011 07:23:35 +0000 (UTC)
|
Complaints-To: | groups-abuse AT google DOT com
|
Injection-Info: | q9g2000yqe.googlegroups.com; posting-host=65.13.115.246; posting-account=p5rsXQoAAAB8KPnVlgg9E_vlm2dvVhfO
|
User-Agent: | G2/1.0
|
X-Google-Web-Client: | true
|
X-Google-Header-Order: | HNKUARELSC
|
X-HTTP-UserAgent: | Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7
|
| (KHTML, like Gecko) Chrome/16.0.912.63 Safari/535.7,gzip(gfe)
|
Bytes: | 3986
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
X-MIME-Autoconverted: | from quoted-printable to 8bit by delorie.com id pBQ7j90A029149
|
Reply-To: | djgpp AT delorie DOT com
|
Hi,
On Dec 26, 12:10 am, jimm <jmich DOT DOT DOT AT yahoo DOT com> wrote:
>
> 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
Isn't GNU ld.exe a bit picky about link order? You may want to keep -
lpth to the end, though that probably won't solve your problem here.
BTW, last I checked, -W is the same as -Wextra, just older / obsolete.
And a.exe is already default (along with a.out), so I don't see why
you'd want to specify that (unless you only wanted a.exe and nothing
else).
> 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.
You need libsocket (/current/v2tk/ls080*.zip) or Watt-32. I'm not sure
the former even fully works (anymore, if ever), so I would suggest
Watt-32 from http://home.broadpark.no/~gvanem/
> 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
Okay, but you're asking for complications which I can't help with. I'm
don't grok multi-threading, sorry. It's a minefield.
> #include <pthread.h> //in djgpp it's pthread.h, not pthreads.h like in
> the example.
All the examples I see at the URL above list it as indeed "pthread.h",
no 's'.
> I extracted pth*.zip
>
> 1. & 2. djgpp does not like the standard gcc compiler switch -XLinker
See latest GCC 4.6.2 manual, section 3.13 "Options for Linking":
"-Xlinker option" (perhaps your capital 'L' confused it?)
http://gcc.gnu.org/onlinedocs/gcc-4.6.2/gcc/Link-Options.html#Link-Options
> or the standard -pthreads which is supposed to be used with
> pthreads.
No, of course that wouldn't be enabled, that presumably means GCC
itself uses threads. Even DJGPP's Ada (GNAT*) doesn't support threads
anymore. :-(
> 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.
Not according to your example above. ;-) But anyways, what you're
using is GNU pth, which has (IIRC) both standard POSIX and its own
API. Anyways, GNU pth is portable but cooperative only. It's somewhat
limited (and our port is buggy, IIRC), so caveat emptor.
http://www.gnu.org/software/pth/
You may have better luck trying FSU Pthreads (see p7zip 9.13) and/or
the examples bundled with the Minix version of FSU (used with
permission):
http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/util/file/7zip/9.13/p7z913.zip
http://minix1.woodhull.com/pub/contrib/champoll.txt
http://minix1.woodhull.com/pub/contrib/champoll.tar.Z
- Raw text -