This is the mail archive of the cygwin@sourceware.cygnus.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]

Creation of dynamic object


Hi,

I'm using the new CygWin B20 and try to create a dynamic object (not a DLL)
which I can access from another executable with dlopen and dlsym.

On Unix I would create this (linking stage) with:

g++    -Wl -shared -o dynobj.so  obj_file1.o obj_file2.o obj_file3.o ... -l...

But with CygWin B20 I get the following errors:

g++: unrecognized option `-shared'
C:\cygnus\CYGWIN~1\H-I586~1\bin\..\lib\gcc-lib\i586-cygwin32\egcs-2.91.57\..\..\
..\..\i586-cygwin32\lib/libcygwin.a(libcmain.o)(.text+0x58):libcmain.cc: undefined reference to `WinMain@16'

So first gcc doesn't seem to recognize the -Wl option so that the '-shared' option goes
to the linker. And of course in that case I have the problem that it seems to need WinMain
which is obviously not included in the objects.

How can I fix this?  Note that I DON'T want to make a DLL.

Greetings and thanks in advance,

--
==============================================================================
Jorrit.Tyberghein@uz.kuleuven.ac.be, University Hospitals KU Leuven BELGIUM

No-one would have believed, in the final years of the Century of the
Fruitbat, that Discworld affairs were being watched keenly and impatiently
by intelligences greater than Man's, or at least much nastier; that their
affairs were being scrutinised and studied as a man with a three-day
appetite might study the All-You-Can-Gobble-For-A-Dollar menu outside
Harga's House of Ribs...
        -- (Terry Pratchett, Moving Pictures)
==============================================================================



-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


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