This is the mail archive of the pthreads-win32@sourceware.cygnus.com mailing list for the pthreas-win32 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Building with MSVC


Hi Erik,

Have a look at buildlib.bat. The options used there work fine. In
particular the link command line is:

<ALL ONE LINE>

cl /LD /Zi *.obj /Fepthread.dll /link /nodefaultlib:libcmt
/implib:pthread.lib msvcrt.lib /def:pthread.def

Cheers.
Ross

On Wed, 27 Oct 1999, Erik Hensema wrote:

> Hi,
> 
> I'm new to MSVC 6.0, and I'm trying to build pthread.dll with cl and nmake.
> Compiling is no problem, but linking fails with and undefined reference to
> _beginthreadex and _endthreadex. According to the MSVC documentation, these
> functions should be in msvcrt.lib and libcmt.lib, however, linking with /MD
> or /MT doesn' work.
> 
> Any clue?
> 
> I've created this makefile:
> 
> OBJ=attr.obj cancel.obj cleanup.obj condvar.obj create.obj dll.obj errno.obj
> \
>         exit.obj fork.obj global.obj misc.obj mutex.obj private.obj
> rwlock.obj \
>         sched.obj semaphore.obj signal.obj sync.obj tsd.obj
> 
> OPT=/I. /c /GD
> 
> all: pthread.dll
> 
> clean:
>         del *.dll *.obj
> 
> pthread.dll: $(OBJ)
>         cl /Fepthread.dll /LD /MT $(OBJ) /link /def:pthread.def
> 
> attr.obj: attr.c
>         cl $(OPT) attr.c
> [...]
> 
> -- 
> Erik Hensema
> Work: erik.hensema@group2000.nl
> Home: erik@hensema.xs4all.nl
> 

+----------------------+---+
| Ross Johnson         |   | E-Mail: rpj@ise.canberra.edu.au
| Info Sciences and Eng|___|
| University of Canberra   | FAX:    +61 6 2015227
| PO Box 1                 |
| Belconnen  ACT    2616   | WWW:    http://willow.canberra.edu.au/~rpj/
| AUSTRALIA                |
+--------------------------+



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]