delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/01/08/12:44:14

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: Wed, 8 Jan 2003 11:29:49 -0500
From: Travis Whitton <whitton AT atlantic DOT net>
To: cygwin AT cygwin DOT com
Subject: Problem going from .o -> .dll
Message-ID: <20030108162949.GA16269@grub.ath.cx>
Reply-To: Travis Whitton <whitton AT atlantic DOT net>
Mime-Version: 1.0
User-Agent: Mutt/1.3.28i
X-Grub-Uptime: 11:12:52 up 7 days, 15:42, 2 users, load average: 1.06, 1.08, 1.03

Hello,
I've created a very small C library using Cygwin to manipulate the serial
port under Windows. My intention is to create a ruby wrapper around the
library and perform some OLE automation, but I've hit a brick wall. I
have a small test program that I'm testing the library with, and it
works perfectly when I compile it against the libraries object file.

I.e.,
gcc -c serial.c
gcc -o driver driver.c serial.o

$ ./driver.exe
(push a button on the scale attached to the serial port)
+  0.1118 g

However, if I compile to object file to a .dll file as indicated in the
Cygwin documentation, things go awry.

I.e.,
gcc -c serial.c
gcc -I. -L. -shared -o serial.dll serial.o
gcc -I. -L. -o driver driver.c -lserial

$ ./driver.exe
EOF
g(smiley face)Err: Close failed

The program no longer blocks to wait for serial data, and it produces
garbage. The only change is that I'm linking against the dll file
instead of the .o file. I have no prior experience with dll creation, so
I'm at a loss as to what to try next. I didn't want to post my entire
program to the list out of courtesy, but you can get it here:

http://grub.ath.cx/~travis/libserial/libserial.tar.gz

Any help would be greatly appreciated,
Travis Whitton <whitton AT atlantic DOT net>

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

- Raw text -


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