X-Spam-Check-By: sourceware.org From: "Dave Korn" To: References: <11331072 DOT post AT talk DOT nabble DOT com> <4682C0EE DOT D7088ADD AT dessent DOT net> <11342161 DOT post AT talk DOT nabble DOT com> <4683D230 DOT 9030705 AT cygwin DOT com> <11348820 DOT post AT talk DOT nabble DOT com> <007801c7b9b6$8d58ec30$2e08a8c0 AT CAM DOT ARTIMI DOT COM> <11362016 DOT post AT talk DOT nabble DOT com> Subject: RE: How to link with third party libraries using gcc Date: Fri, 29 Jun 2007 16:35:29 +0100 Message-ID: <012a01c7ba63$1f4c4810$2e08a8c0@CAM.ARTIMI.COM> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <11362016.post@talk.nabble.com> Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 On 29 June 2007 16:19, km4hr wrote: > Dave, > > 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. cheers, DaveK -- Can't think of a witty .sigline today.... -- 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/