Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <20030609215113.72715.qmail@web21506.mail.yahoo.com> Date: Mon, 9 Jun 2003 14:51:13 -0700 (PDT) From: JS Subject: Help! (creating a dynamically linked shared library) To: cygwin AT cygwin DOT com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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/