This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


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

Linking to cygwin1.dll and msvcrt.dll ?


Hi all.

I am trying to figure out how to create a .dll
that depends on cygwin1.dll and msvcrt.dll.
Here is the link time error I am currently seeing:

gcc -shared -g -o tcl84d.dll -Wl,--out-implib,libtcl84d.a 
regcomp.o regexec.o regfree.o regerror.o tclAlloc.o tclAsync.o tclBasic.o 
tclBinary.o tclCkalloc.o tclClock.o tclCmdAH.o tclCmdIL.o tclCmdMZ.o 
tclCompCmds.o tclCompExpr.o tclCompile.o tclDate.o tclEncoding.o tclEnv.o 
tclEvent.o tclExecute.o tclFCmd.o tclFileName.o tclGet.o tclHash.o 
tclHistory.o tclIndexObj.o tclInterp.o tclIO.o tclIOCmd.o tclIOGT.o 
tclIOSock.o tclIOUtil.o tclLink.o tclLiteral.o tclListObj.o tclLoad.o 
tclMain.o tclNamesp.o tclNotify.o tclObj.o tclPanic.o tclParse.o 
tclParseExpr.o tclPipe.o tclPkg.o tclPosixStr.o tclPreserve.o tclProc.o 
tclRegexp.o tclResolve.o tclResult.o tclScan.o tclStringObj.o 
tclStubInit.o tclStubLib.o tclThread.o tclThreadJoin.o tclTimer.o 
tclUtf.o tclUtil.o tclVar.o tclWin32Dll.o tclWinChan.o tclWinConsole.o 
tclWinSerial.o tclWinError.o tclWinFCmd.o tclWinFile.o tclWinInit.o 
tclWinLoad.o tclWinMtherr.o tclWinNotify.o tclWinPipe.o tclWinSock.o 
tclWinThrd.o tclWinTime.o  strftime.o tcl.res.o 

Creating library file: libtcl84d.a
tclWinThrd.o(.text+0x2e): undefined reference to `_beginthreadex'
tclWinThrd.o(.text+0xf5): undefined reference to `_endthreadex'
collect2: ld returned 1 exit status
make: *** [tcl84d.dll] Error 1


When building with the -no-cygwin, the -lmsvcrt
flag is automatically passed to the linker. Thing
is you can't just pass -lmsvcrt to Cygwin's gcc
because the libmsvcrt.a file lives in
/lib/mingw/libmsvcrt.a which is only searched
when -mno-cygwin is passed.

These calls to _beginthreadex and _endthreadex
are made instead of calling CreateThread and
ExitThread because of a problem with memory
leaks.

Any ideas how I can work around this problem?

thanks
Mo DeJong
Red Hat Inc

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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