delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/12/07/20:19:51

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Thu, 7 Dec 2000 20:18:31 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Trouble accessing functions in cygwin1.dll
Message-ID: <20001207201831.D18739@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <010401c06010$3099e870$4c3ca8c0 AT adacel DOT com DOT au> <20001207020546 DOT C13259 AT redhat DOT com> <000d01c060a9$fe8b85b0$4c3ca8c0 AT adacel DOT com DOT au>
Mime-Version: 1.0
User-Agent: Mutt/1.3.11i
In-Reply-To: <000d01c060a9$fe8b85b0$4c3ca8c0@adacel.com.au>; from petert@adacel.com.au on Fri, Dec 08, 2000 at 11:01:19AM +1100

On Fri, Dec 08, 2000 at 11:01:19AM +1100, Peter Tersteeg wrote:
>>>I'm trying to use cygwin in a VC++ project (not pleasant, but I don't
>>>have a choice) and I'm trying to access several functions using
>>>LoadLibrary and GetProcAddress.  I've used assertions to check that
>>>they are found successfully, but at runtime the program crashes when
>>>calling any of these functions.
>>
>>It's not ok.  The fact that the program crashes should be a mild hint
>>that this is so.
>>
>>You can't call cygwin from a VC++ program unless you really really know
>>what you're doing.  And even then, I'm not too sure.
>
>I'm not sure that I understand this statement.  My understanding of
>DLL's is that they run are basically a library which any windows based
>compiler should be able to link to.  It should be irrelevant what
>compiler is used, so long as it supports the platform.
>
>Does this mean that I have to build and run under the bash shell?  I'd
>prefer not to be constrained by this if I can help it.

Wait a minute.  Maybe I "misspoke" here.  It is possible to do this and
get limited functionality.  Sorry.

You need to call "cygwin_dll_init" (via GetProcAddress of course) prior
to using any cygwin functions.  This function takes no arguments.

This doesn't mean that you'll be able to call every single cygwin
function.  Some, like fork() won't work.  Possibly signal handling won't
work.  And, you still won't necessarily be able to call cygwin functions
that conflict with Microsoft functions, like printf.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019