delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/10/16/14:23:40

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Thu, 16 Oct 2003 14:22:41 -0400 (EDT)
From: Paul Bezzam <bezzam AT astro DOT ocis DOT temple DOT edu>
X-X-Sender: bezzam AT gs873ps
To: cygwin AT cygwin DOT com
Subject: Re: DLL and VB problems
In-Reply-To: <Pine.OSF.4.53.0310161415160.908491@gs873ps>
Message-ID: <Pine.OSF.4.53.0310161420180.908491@gs873ps>
References: <Pine DOT OSF DOT 4 DOT 53 DOT 0310161141450 DOT 875203 AT gs873ps>
<Pine DOT GSO DOT 4 DOT 56 DOT 0310161148520 DOT 20462 AT slinky DOT cs DOT nyu DOT edu>
<Pine DOT OSF DOT 4 DOT 53 DOT 0310161405140 DOT 908491 AT gs873ps> <Pine DOT OSF DOT 4 DOT 53 DOT 0310161415160 DOT 908491 AT gs873ps>
MIME-Version: 1.0

The options I gave to gcc are:

For building the DLL:
gcc -c -o dllhello.o dllhello.c
gcc -shared -o dllhello.dll dllhello.o -Wl,--out-implib,libdllhello.a

For building the program:
gcc -c -o hello.o hello.c
gcc -mwindows -o hello.exe hello.o -L. -ldllhello

The GCC version I am using is: gcc (GCC) 3.3.1 (cygming special)

Yes, I can successfully call this dll from a C program.

Thanks.

Paul

On Thu, 16 Oct 2003, Paul Bezzam wrote:

>
> Hello,
>
> Please ignore my previous message;  I made a mistake in the client C file.
> I corrected it, and the C client calls the DLL perfectly.
>
> But I tried calling from a VB client, and it works fine for the first
> time;  Running again causes the application to close.
>
> Any insight would be greatly appreciated.
>
> Thanks.
>
> Paul
>
> On Thu, 16 Oct 2003, Paul Bezzam wrote:
>
> >
> > Hello,
> >
> > I am sorry that I am not very clear...
> >
> > Below is the problem:
> >
> > I wrote C client to this dll and when I try to compile the client to use
> > the dll using the command: gcc -o hello.exe hello.o -L. -ldllhello,  I get
> > the following error:
> > /usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../libcygwin.a(libcmain.o)(.text+0x7
> > c): undefined reference to `_WinMain AT 16'
> > collect2: ld returned 1 exit status
> >
> > PS: dllhello is the dll; hello.c is the client C program.
> >
> > Thank you.
> >
> > Paul
> >
> >
> >
> > On Thu, 16 Oct 2003, Igor Pechtchanski wrote:
> >
> > > On Thu, 16 Oct 2003, Paul Bezzam wrote:
> > >
> > > > Hello,
> > > >
> > > > I have created a DLL using gcc on Cygwin, and I wrote a client in VB
> > > > accessing this DLL.  The application runs fine for the first time, but
> > > > when run again, it crashes.  I have to close the application and run it to
> > > > work successfully.
> > > >
> > > > Can anyone please give me some directions.
> > > >
> > > > Thanks.
> > > > Paul
> > >
> > > "Crashes" is a very vague word.  Where does it crash?  What options did
> > > you give to GCC?  What version of GCC are you using?  Can you use this DLL
> > > from a C program?
> > > 	Igor
> > > --
> > > 				http://cs.nyu.edu/~pechtcha/
> > >       |\      _,,,---,,_		pechtcha AT cs DOT nyu DOT edu
> > > ZZZzz /,`.-'`'    -.  ;-;;,_		igor AT watson DOT ibm DOT com
> > >      |,4-  ) )-,_. ,\ (  `'-'		Igor Pechtchanski, Ph.D.
> > >     '---''(_/--'  `-'\_) fL	a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!
> > >
> > > "I have since come to realize that being between your mentor and his route
> > > to the bathroom is a major career booster."  -- Patrick Naughton
> > >
> > > --
> > > Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> > > Problem reports:       http://cygwin.com/problems.html
> > > Documentation:         http://cygwin.com/docs.html
> > > FAQ:                   http://cygwin.com/faq/
> > >
> > >
> >
> > --
> > Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> > Problem reports:       http://cygwin.com/problems.html
> > Documentation:         http://cygwin.com/docs.html
> > FAQ:                   http://cygwin.com/faq/
> >
> >
>
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Problem reports:       http://cygwin.com/problems.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/
>
>

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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