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]
Other format: [Raw text]

Problem going from .o -> .dll


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@atlantic.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/


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