Re: Beginning with Kernel Extension Concepts
site_archiver@lists.apple.com Delivered-To: Darwin-kernel@lists.apple.com On Mar 13, 2007, at 3:07 PM, Michael Crawford wrote: Could you be compiling the code as C and not C++? extern "C" is legal in C++, but not C. You definitely want to compile as C++ for I/O Kit drivers. Mike Crawford mdcrawford at gmail dot com Bonjour à tous, //--------------------- /* add your code here */ #include <IOKit/IOLib.h> #include "HelloIOKit.h" extern "C" { #include <pexpert/pexpert.h> } // For debugging purpose only [...] //------------------- Thanks. Francis. This email sent to mdcrawford@gmail.com -- Michael David Crawford mdcrawford at gmail dot com Enjoy my art, photography, music and writing at http://www.geometricvisions.com/ --- Free Music Downloads --- _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... Well, I am using Xcode (2.4.1), the project was initiated with the Assistant ( Kernel Extension/IOKit Driver ), generated this C++ file, and I understand the compilation process is aware of the project being C++ (where the extern "C" form is known to call for a C construct - the included pexpert.h looks like pure C ). So I understand this line is the way to call pure C from C++ - never mind. I have edited the info.plist and the HelloIOKit header file as per the tutorial. And I believe I am compiling C++ code. So ... ? On 3/13/07, Francis Derive <francisderive@mac.com> wrote:
From Apple Dev Documentation, I get an error : "expected unqualified-id
before string constant" - on line 5 in the HelloIOKit.cpp file of this "Hello I/O Kit : Creating a Device Driver With XCode" chapter. I stare at it and can't think anything brilliant about it. First, I am not sure about where the error raised from : the call to a "C " construct, or the line before ? _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/mdcrawford% 40gmail.com This email sent to site_archiver@lists.apple.com
participants (1)
-
Francis Derive