This is the mail archive of the
mailing list for the Cygwin project.
Help! (creating a dynamically linked shared library)
- From: JS <etoilee_nuit at yahoo dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 9 Jun 2003 14:51:13 -0700 (PDT)
- Subject: Help! (creating a dynamically linked shared library)
I'm trying to build a .dll and .lib file in cygwin,
so I can compile and build them in DOS (under windows
later. I created a simple file called add.cpp that
calls on a function, addfunction.cpp, to add two
First I compiled addfunction.cpp, then I created an
export file and a .lib file. When I tried to use the
export file and .o file to create the .dll file, I got
an error saying:
: undefined reference to `_WinMain@16'.
I looked that up in the FAQ, and it said to add an
empty main() into the file....but this is a function
file. I tried adding the main() in hopes that it
would work, and it did compile, but the extra main()
created problems later when I was trying to build the
.exe in DOS (using: cl add.cpp function.lib).
Does anyone have any idea as to how I might fix
These are the commands I used to create the .lib and
gcc -c function.c
dlltool -e exports.o -l function.lib function.o
gcc function.o exports.o -o function.dll
(it was after the last command line that I got the
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html