This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project. See the Cygwin home page for more information.
Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: part 2: mixing GNU and MS tools/libraries...


Glauco Masotti wrote:
> 
> Hello. I would like to thank Anders Norlander who gave me the necessary
> hints to unblock the situation. Thanks also to Fergus Henderson, Earnie Boyd
> and Mikey for their contribution.
> 
> Although I made some progress, however I couldn't solve the problem
> completely jet.
> Well, me10f.lib is a dll import library, so I used the sequence suggested
> by Anders
> to build me10.def and libme10f.a, so I am supposed now to be able to use ld
> -r
> to link my stuff with ME10 goodies.
> Unfortunately I also have to access *global data* that resides in me10.exe
> image.
> These data are defined in the code as DllImport variables and correspond to
> symbols
> prefixed by __imp_ for the loader.
> The problem is that I get all these symbols unresolved now!
> What else should I do to move off shoals?

A data symbol imported from an external dll/executable is actually a
pointer to the external data, therefore you need to tell the compiler
how to access the data. You do so by using the __declspec(dllimport)
directive in extern declarations.

As data symbols are treated the same as any other symbol by the win32
loader you need to include them in your .def file as well when building
the import library.

Regards,
Anders

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com