delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/10/30/09:26:53

X-Spam-Check-By: sourceware.org
Date: Mon, 30 Oct 2006 08:26:27 -0600
From: Brian Ford <Brian DOT Ford AT FlightSafety DOT com>
Reply-To: cygwin AT cygwin DOT com
To: cygwin AT cygwin DOT com
Subject: Re: device drivers - general info
In-Reply-To: <454165E7.1080700@cygwin.com>
Message-ID: <Pine.CYG.4.58.0610300821130.3892@PC1163-8460-XP.flightsafety.com>
References: <d3e5bdd70610251148i10a2581cv2e4754918e485f6 AT mail DOT gmail DOT com> <003c01c6f8a6$5d20fb60$020aa8c0 AT DFW5RB41> <d3e5bdd70610261408w748816f8kc530a9605afcb9f4 AT mail DOT gmail DOT com> <454165E7 DOT 1080700 AT cygwin DOT com>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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 Thu, 26 Oct 2006, Larry Hall (Cygwin) wrote:
> George Locke wrote:
> > On 10/25/06, Gary R. Van Sickle wrote:
> >> > From: George Locke
> >> > Sent: Wednesday, October 25, 2006 1:48 PM
> >> >
> >> > I wish to create a C++ program that communicates with a
> >> > windows device driver (for a PCI card that interfaces with
> >> > external electronics).
> >> > The maker of the driver has provided a C++ library that
> >> > allows me to write C++ programs that communicate with the PCI
> >> > card, and i know that this works in regular windows, but i am
> >> > feeling unsure about whether it will work in Cygwin.
> >>
> >> If the C++ library is not provided in source-code form, you're pretty
> >> much out of luck, due to name-mangling differences and other issues.
> >> If they're giving you a C++ source library that ultimately
> >> communicates with the kernel-level driver via normal Win32
> >> filehandles and/or IOCTLs, I would say, "if you've followed me so
> >> far, in general this kind of thing can be made to work, but be
> >> prepared to roll up your sleeves, because odds are that the code was
> >> written for Visual Studio."
> >>
>  > the header for the for the external library does exist as source code,
>  > eg #include "foo.h" where foo.h is C++ source code, but the functions
>  > aren't defined within that file (just prototyped), and afaik they are
>  > not defined anywhere in raw source code format.  If that is good
>  > enough then i have a place to start.
>
> No.  You'll need to use the same C++ compiler as was used to generate this
> library.

Or, to add a messy but sometimes useful option not previously directly
mentioned in this thread, use the same C++ compiler as was used to
generate this library to create an extern C wrapper API.  The C wrapper
API may then be called from Cygwin (gcc) C or C++ code.

-- 
Brian Ford
Lead Realtime Software Engineer
VITAL - Visual Simulation Systems
FlightSafety International
the best safety device in any aircraft is a well-trained crew...



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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019