public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Linking to cygwin1.dll and msvcrt.dll ?
@ 2001-07-17 12:59 Mo DeJong
  2001-07-17 13:02 ` Christopher Faylor
  0 siblings, 1 reply; 15+ messages in thread
From: Mo DeJong @ 2001-07-17 12:59 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] 15+ messages in thread
* RE: Linking to cygwin1.dll and msvcrt.dll ?
@ 2001-07-17 13:36 Steve Jorgensen
  0 siblings, 0 replies; 15+ messages in thread
From: Steve Jorgensen @ 2001-07-17 13:36 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

How would this relate to a Cygwin app (links against cygwin1.dll) that also 
uses a native Windows DLL that probably uses msvcrt.dll (such as GTK+)?

Is this allowed or disallowed?

Sorry if this appears twice.  I messed up and can't tell if I already sent 
it

-----Original Message-----
From:	Christopher Faylor [SMTP:cgf@redhat.com]
Sent:	Tuesday, July 17, 2001 1:02 PM
To:	cygwin@cygwin.com
Subject:	Re: Linking to cygwin1.dll and msvcrt.dll ?

On Tue, Jul 17, 2001 at 12:59:46PM -0700, Mo DeJong wrote:
>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:

You can't do that.  You can't mix two different runtime systems
they are mutually exclusive.

cgf

--
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/


--
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/

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2001-07-22  5:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-17 12:59 Linking to cygwin1.dll and msvcrt.dll ? Mo DeJong
2001-07-17 13:02 ` Christopher Faylor
2001-07-17 14:12   ` Mumit Khan
2001-07-17 15:04     ` Corinna Vinschen
2001-07-17 16:01       ` Mo DeJong
2001-07-18  1:46         ` Corinna Vinschen
2001-07-19 16:13           ` Mo DeJong
2001-07-20 10:09             ` Mumit Khan
2001-07-21 14:26               ` Mo DeJong
2001-07-21 15:02                 ` Spaces in User Name Dave BT
2001-07-21 17:07                 ` Linking to cygwin1.dll and msvcrt.dll ? Robert Collins
2001-07-21 20:31                   ` Trevor Forbes
2001-07-21 21:24                     ` Christopher Faylor
2001-07-22  5:45                     ` Robert Collins
2001-07-17 13:36 Steve Jorgensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).