How to use pth207b.zip?

16 views
Skip to first unread message

gnufan42 (gnufan42@protonmail.com) [via djgpp@delorie.com]

unread,
Nov 16, 2021, 9:55:31 AM11/16/21
to dj...@delorie.com
I must use pthread library to port a program to DOS. I'm using cygwin and I'm cross-compiling. The djgpp-gcc cygwin provided didn't come up with the library so I downloaded pth207b.zip. I'm sure I extracted the files to correct places. After I've done that I tried to compile a simple test program, but gcc said that it can't find sys/socket.h and it is included by pthread.h. I have no idea why on earth a thread library needs network but according to the FAQ (https://www.delorie.com/djgpp/v2faq/faq22_4.html). I chose WATTCP library and downloaded tcplib.zip. Then the gcc said that it can't find sys/wtime.h. I found that file in wat3222br2.zip so I copied wat3222br2.zip/net/watt/inc to /usr/i586-msdosdjgpp/include and wat3222br2.zip/net/watt/lib to /usr/i586-msdosdjgpp/lib. I thought that should solve the problem but no. The gcc popped up with a bunch of errors about redefinition and conflicting declaration.
So what I did wrong?
Thanks,
Gnufan

$ gcc ./pth_test.c
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/socket.h:14:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:113,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/sys/osdep.h:143:16: error: redefinition of ‘struct fd_set’
typedef struct fd_set {
^
In file included from /usr/i586-pc-msdosdjgpp/include/pthread.h:111:0,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/sys/types.h:76:16: error: previous definition of ‘struct fd_set’
typedef struct fd_set {
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/socket.h:14:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:113,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/sys/osdep.h:145:3: error: conflicting declaration ‘typedef int fd_set’
} fd_set;
^
In file included from /usr/i586-pc-msdosdjgpp/include/pthread.h:111:0,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/sys/types.h:78:3: note: previous declaration as ‘typedef struct fd_set fd_set’
} fd_set;
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/select.h:6:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:117,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/tcp.h:35:22: error: conflicting declaration ‘typedef unsigned int word’
typedef unsigned int word;
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/socket.h:12:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:113,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/sys/wattcp.h:68:24: note: previous declaration as ‘typedef short unsigned int word’
typedef unsigned short word; /* 16 bits */
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/select.h:6:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:117,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/tcp.h:43:3: error: conflicting declaration ‘typedef struct tcp_Socket tcp_Socket’
} tcp_Socket;
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/socket.h:12:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:113,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/sys/wattcp.h:277:3: note: previous declaration as ‘typedef struct _tcp_socket tcp_Socket’
} tcp_Socket;
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/select.h:6:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:117,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/tcp.h:47:3: error: conflicting declaration ‘typedef struct udp_Socket udp_Socket’
} udp_Socket;
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/socket.h:12:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:113,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/sys/wattcp.h:211:3: note: previous declaration as ‘typedef struct _udp_socket udp_Socket’
} udp_Socket;
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/tcp.h:49:0,
from /usr/i586-pc-msdosdjgpp/sys-include/sys/select.h:6,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:117,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/extsock.h:5:3: error: conflicting declaration ‘typedef union sock_type sock_type’
} sock_type;
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/wattcp.h:279:0,
from /usr/i586-pc-msdosdjgpp/sys-include/sys/socket.h:12,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:113,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/extsock.h:5:3: note: previous declaration as ‘typedef union sock_type sock_type’
} sock_type;
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/tcp.h:49:0,
from /usr/i586-pc-msdosdjgpp/sys-include/sys/select.h:6,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:117,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/extsock.h:17:3: error: conflicting declaration ‘typedef struct _ext_socket _ext_socket’
} _ext_socket;
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/wattcp.h:279:0,
from /usr/i586-pc-msdosdjgpp/sys-include/sys/socket.h:12,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:113,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/extsock.h:17:3: note: previous declaration as ‘typedef struct _ext_socket _ext_socket’
} _ext_socket;
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/select.h:6:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:117,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/tcp.h:51:16: error: redefinition of ‘struct sockaddr_wat’
typedef struct sockaddr_wat {
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/socket.h:12:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:113,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/sys/wattcp.h:310:16: error: previous definition of ‘struct sockaddr_wat’
typedef struct sockaddr_wat {
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/select.h:6:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:117,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/tcp.h:58:16: error: redefinition of ‘struct in_addr’
typedef struct in_addr {
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/socket.h:9:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:113,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/sys/sockaddr.h:19:8: error: previous definition of ‘struct in_addr’
struct in_addr {
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/select.h:6:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:117,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/tcp.h:73:18: error: ambiguating new declaration of ‘int sock_init()’
extern sock_init();
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/socket.h:12:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:113,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/sys/wattcp.h:415:13: note: old declaration ‘void sock_init()’
extern void sock_init( void );
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/select.h:6:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:117,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/tcp.h:112:31: error: ambiguating new declaration of ‘int isaddr(char*)’
extern int isaddr( char *text );
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/socket.h:12:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:113,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/sys/wattcp.h:378:13: note: old declaration ‘word isaddr(char*)’
extern word isaddr( char *string );
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/select.h:6:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:117,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/tcp.h:238:23: error: ambiguating new declaration of ‘void _eth_init()’
extern void _eth_init();
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/socket.h:12:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:113,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/sys/wattcp.h:321:13: note: old declaration ‘int _eth_init()’
extern int _eth_init( void );
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/select.h:6:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:117,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/tcp.h:240:32: error: ambiguating new declaration of ‘void _eth_send(word)’
extern void _eth_send( word len);
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/socket.h:12:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:113,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/sys/wattcp.h:323:14: note: old declaration ‘int _eth_send(word)’
extern int _eth_send( word len);
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/select.h:6:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:117,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/tcp.h:259:37: error: ambiguating new declaration of ‘char* psocket(tcp_Socket*)’
extern char *psocket( tcp_Socket *s );
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/socket.h:12:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:113,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/sys/wattcp.h:401:13: note: old declaration ‘void psocket(tcp_Socket*)’
extern void psocket( tcp_Socket *s );
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/select.h:6:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:117,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/tcp.h:265:27: error: ambiguating new declaration of ‘longword gethostid()’
extern longword gethostid();
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/socket.h:12:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:113,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/sys/wattcp.h:407:6: note: old declaration ‘long int gethostid()’
long gethostid( void );
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/select.h:6:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:117,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/tcp.h:269:50: error: ambiguating new declaration of ‘char* gethostname(char*, int)’
extern char *gethostname( char *name, int length );
^
In file included from /usr/i586-pc-msdosdjgpp/include/pthread.h:116:0,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/unistd.h:172:6: note: old declaration ‘int gethostname(char*, int)’
int gethostname(char *buf, int size);
^
In file included from /usr/i586-pc-msdosdjgpp/sys-include/sys/select.h:6:0,
from /usr/i586-pc-msdosdjgpp/include/pthread.h:117,
from pth_test.cpp:2:
/usr/i586-pc-msdosdjgpp/sys-include/tcp.h:279:8: error: ‘_survivebootp’ does not name a type
extern _survivebootp;
^
pth_test.cpp: In function ‘void* {anonymous}::start_routine(void*)’:
pth_test.cpp:32:27: error: ‘nullptr’ was not declared in this scope
void* no_status = nullptr;
^
pth_test.cpp: In function ‘bool a11c()’:
pth_test.cpp:80:27: error: ‘nullptr’ was not declared in this scope
{ void* no_status = nullptr;
^


mingd...@gmail.com

unread,
Nov 17, 2021, 1:20:28 AM11/17/21
to
G4> I must use pthread library to port a program to DOS. ...so I downloaded
G4> pth207b.zip. ...but gcc said that it can't find sys/socket.h. I chose
G4> WATTCP library and downloaded tcplib.zip. Then the gcc said that it can't
G4> find sys/wtime.h. I found that file in wat3222br2.zip

WatTCP appears fairly incompatible, though I've had some success with
ls080s.zip dated 08jul2002 from v2tk/.

regards,
- Mdasoh Kyaeppd.
Reply all
Reply to author
Forward
0 new messages