Thread overview
win32 pthread , try #2
Jun 26, 2004
Anuj Goyal
Jun 27, 2004
Mark Junker
Jun 27, 2004
Anuj Goyal
Jun 27, 2004
Mark Junker
Jun 28, 2004
Anuj Goyal
June 26, 2004
ok,

I got a little bit further, I don't get the error message, my executable runs, but there is no output on the screen.

I changed the link line from this:

dmc -I.;c:dminclude -WA hello.c pthread.lib

to:

dmc -I.;c:dminclude -WA hello.c pthread.lib -L/SU:POSIX

I think I am building my pthread.dll,pthread.lib improperly...  I am probably doing something wrong in the link step, but someone with OPTLINK expertise needs to help me!

When I use depends, it tell me that I am doing something wrong....

I also tried this one:

dmc -I.;c:dminclude -WA hello.c pthread.lib -L/IMPL -L/SU:WINDOWS:4.1

this one gives me the "best" performance, ie the error mesage box comes back VERY quickly!  and the command prompt comes back (this does not happen in the non-posix, non-windows case)

Thanks for your patience, I have I need to know a lot about this product before just jumping in and porting.  I am continuing to read the guides in http://www.digitalmars.com/ctg/ctg.html


June 27, 2004
Anuj Goyal schrieb:

> dmc -I.;c:dminclude -WA hello.c pthread.lib -L/SU:POSIX

Try CONSOLE instead of POSIX.

Regards,
Mark
June 27, 2004
doesn't seem to like that either:

C:\workdmc\pthread>dmc -I.;c:\dm\include -D_MT -o+all -DHAVE_CONFIG_H -WD
pthread.c u
ser32.lib+kernel32.lib+wsock32.lib -L/impl -L/SU:CONSOLE
link pthread,,,user32.lib+kernel32.lib+wsock32,pthread/noi/impl/SU:CONSOLE;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

pthread.def(4) : Error 112: SUBSYSTEM Directive
SUBSYSTEM WINDOWS

^

--- errorlevel 1


C:\workdmc\pthread>dmc -I.;c:\dm\include -D_MT -o+all -DHAVE_CONFIG_H -WD
pthread.c u
ser32.lib+kernel32.lib+wsock32.lib -L/impl -L/SUBSYSTEM:CONSOLE
link
pthread,,,user32.lib+kernel32.lib+wsock32,pthread/noi/impl/SUBSYSTEM:CONSOLE;
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

pthread.def(4) : Error 112: SUBSYSTEM Directive
SUBSYSTEM WINDOWS

^

--- errorlevel 1

In article <cbmfhd$3m9$1@digitaldaemon.com>, Mark Junker says...
>
>Anuj Goyal schrieb:
>
>> dmc -I.;c:dminclude -WA hello.c pthread.lib -L/SU:POSIX
>
>Try CONSOLE instead of POSIX.
>
>Regards,
>Mark


June 27, 2004
Anuj Goyal schrieb:

> doesn't seem to like that either:
> 
> C:\workdmc\pthread>dmc -I.;c:\dm\include -D_MT -o+all -DHAVE_CONFIG_H -WD
> pthread.c u
> ser32.lib+kernel32.lib+wsock32.lib -L/impl -L/SU:CONSOLE
> link pthread,,,user32.lib+kernel32.lib+wsock32,pthread/noi/impl/SU:CONSOLE;
> OPTLINK (R) for Win32  Release 7.50B1
> Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
> 
> pthread.def(4) : Error 112: SUBSYSTEM Directive
> SUBSYSTEM WINDOWS
> 
> ^
> 
> --- errorlevel 1

You're implicitly using pthread.def, just remove the "SUBSYSTEM" directive from it.
June 28, 2004
ok, now i'm getting compile errors (I somehow was able to compile before!)

this parameter list looks ok to me... they are forward declarartions...unless dmc is more strict about forward declarations than other compilers.

I think something is up with PAPCFUNC (implement.h ~ line 500) ... I'm
investigating....

C:\workdmc\pthread>dmc -I. -D_MT -o+all -DHAVE_CONFIG_H -WD pthread.c
user32.lib+kernel32.lib+wsock32.lib -L/imp
int ptw32_is_attr (const pthread_attr_t * attr);
^
implement.h(494) : Error: parameter list is out of context
ptw32_RegisterCancelation (PAPCFUNC callback,
^
implement.h(506) : Error: ')' expected to close function parameter list with
HANDLE threadH, DWORD callback_arg);
^
implement.h(507) : Error: 'HANDLE' is not in function parameter list
int ptw32_processInitialize (void);
^
implement.h(509) : Error: 'ptw32_processInitialize' is not in function parameter
list

void ptw32_processTerminate (void);
^
implement.h(511) : Error: 'ptw32_processTerminate' is not in function parameter
list
Fatal error: too many errors
--- errorlevel 1


In article <cbnbti$18hp$1@digitaldaemon.com>, Mark Junker says...
>
>Anuj Goyal schrieb:
>
>> doesn't seem to like that either:
>> 
>> C:\workdmc\pthread>dmc -I.;c:\dm\include -D_MT -o+all -DHAVE_CONFIG_H -WD
>> pthread.c u
>> ser32.lib+kernel32.lib+wsock32.lib -L/impl -L/SU:CONSOLE
>> link pthread,,,user32.lib+kernel32.lib+wsock32,pthread/noi/impl/SU:CONSOLE;
>> OPTLINK (R) for Win32  Release 7.50B1
>> Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
>> 
>> pthread.def(4) : Error 112: SUBSYSTEM Directive
>> SUBSYSTEM WINDOWS
>> 
>> ^
>> 
>> --- errorlevel 1
>
>You're implicitly using pthread.def, just remove the "SUBSYSTEM" directive from it.