Mail Archives: cygwin/2003/06/09/17:51:25
Hi,
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
numbers.
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:
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../libcygwin.a(libcmain.o)(.text+0x7c)
: undefined reference to `_WinMain AT 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
this?
These are the commands I used to create the .lib and
exports.o files:
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
error)
Thanks,
Julie
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
--
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 -