Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Using IOKit in normal terminal gcc

Using IOKit in normal terminal gcc
Thread Tools
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Sep 10, 2002, 08:45 PM
 
Hi,

How can I use Mac OS X libraries in gcc in the terminal, such as:

#include <IOKit/IOATACommand.h>

in a c++ program taht I create in a text editor and then do "c++ -o program program.cpp"

when i try it, it complains that it cant find IOKit/IOATACommand.h


any help woudl be much appreaciated!

thanks!

karl
     
Fresh-Faced Recruit
Join Date: Aug 2002
Status: Offline
Reply With Quote
Sep 11, 2002, 03:50 AM
 
you'll need to add '-framework IOKit' to that
     
timmerk  (op)
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Sep 11, 2002, 07:09 AM
 
Originally posted by eggboons:
you'll need to add '-framework IOKit' to that
So like this?

c++ -o program -framework IOKit program.cpp

Thanks
     
timmerk  (op)
Mac Elite
Join Date: Jan 2001
Status: Offline
Reply With Quote
Sep 11, 2002, 02:58 PM
 
i tired this:

c++ -o ata -framework IOKit ata.cpp


and it said:

ata.cpp:3:32: IOKit/IOATACommand.h: No such file or directory

line 32 is this: "#include <IOKit/IOATACommand.h>"


any ideas?

thanks
     
Mac Enthusiast
Join Date: Sep 2000
Location: Cupertino, CA
Status: Offline
Reply With Quote
Sep 16, 2002, 02:11 AM
 
Originally posted by timmerk:
Hi,

How can I use Mac OS X libraries in gcc in the terminal, such as:

#include <IOKit/IOATACommand.h>

in a c++ program taht I create in a text editor and then do "c++ -o program program.cpp"

when i try it, it complains that it cant find IOKit/IOATACommand.h


any help woudl be much appreaciated!

thanks!

karl
The generic answer and the specific answer are different. I could walk through everything you need to do to include random libraries, but that is not your problem.

IOKit/IOATACommand.h defines functions that are only exposed *inside* the kernel. It for use by kernel extensions. Hence there is no way to get a successful link against it for a userspace program.

Louis
Louis Gerbarg
Darwin Developer
These are my views, and not the views of my employer.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:46 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2