This is the mail archive of the 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]

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


Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).

Unsubscribe info:
Problem reports:

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