This is the mail archive of the
mailing list for the Cygwin project.
RE: How to link with third party libraries using gcc
On 29 June 2007 16:19, km4hr wrote:
> The libraries I'm dealing with provide an C programming interface to an
> industrial control system. The system is a Fisher DCS (distributed control
> system). The DCS contains thousands of temperatures, pressures, flowrates,
> etc from processes in our plant. I create programs that access that
> information. My programs analyze the info to evaluate production
> efficiencies, reporting, performance testing, etc. The Fisher libraries are
> available on Unix,VMS, and Windows. I use the Unix version. But there are
> times when it would be convenient to run the programs on Windows. I just
> don't want to learn the Windows programming environment. So I was
> experimenting with cygwin to see if there might be some magic that could
> allow the transfer of programs from Unix to Windows easily.
Alas, no. The problem here is that cygwin is not just-plain-windoze. The
libraries you have are build with standard windoze tools, they link against
the MSVC runtime, expect to have their own malloc heap, file handle table,
thread handling, etc etc... whereas cygwin, in order to provide posix
emulation at the recompile-your-source-and-it-just-works level, requires to
control all those things on behalf of your code. The foreign libraries will
go behind its back and confuse it. You would need a version of those
libraries built and linked against cygwin and then the porting would be easy,
you'd just recompile and run.
In this situation, probably your best bet for posix portability plus
compatibility with native win32 libraries would be to use MSYS and MinGW to
recompile your unix programs. They are based around the windoze native (MSVC)
runtime and libraries. The downside is that they don't provide as much of the
posix api as cygwin does, because they can't do all the emulation that cygwin
does; the plus-side is that they're compatible with native builds. So you
might need to sprinkle a few #ifdefs through your code to avoid tricky
functions that MSYS/MinGW don't support, but other than that you might be in
luck. You'll have to ask on a MSYS/MinGW mailing list for further advice
about this, it's not our speciality here, but it might well do what you need.
Can't think of a witty .sigline today....
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html