 |
 |
Header problems
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jun 2001
Location: France
Status:
Offline
|
|
I develop an USB ISDN Modem Driver for MacOS X.
I use IOKit, but I have some problems with header files.
Project Builder seems not to find all headers...
For example, when I put :
#include <IOKit/usb/IOUSBLib.h>
in my source code, the Project Builder compiler says :
IOKit/usb/IOUSBLib.h: no such file or directory...
It's the same for
#include <IOKit/usb/IOUSBPipe.h>
However,
#include <IOKit/usb/USBSpec.h>
#include <IOKit/usb/USB.h>
works well!
#include <IOKit/IOKitLib> doesn't work too
Why can I do for this? I want to use many of these frameworks!
Tanks for help!
Regards,
Cedric Vuillet
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status:
Offline
|
|
Well, it's #include <IOKit/IOKitLib.h> not #include <IOKit/IOKitLib>. You forgot the .h
Have you remembered to make the IOKit framework part of your project in Project Builder? There's an Add Frameworks... menu option in the Project menu.
|
|
|
| |
|
|
|
 |
|
 |
|
Fresh-Faced Recruit
Join Date: Jun 2001
Location: France
Status:
Offline
|
|
I put the IOKit framework.
I tried to include the IOUSBPipe.h ,which is referenced in Apple site. But this header is not in IOKit framework, it's in the Kernel framework, so I change the include <IOKit/usb/IOUSBPipe.h> to include <Kernel/IOKit/usb/IOUSBPipe.h> . Ok, project builder found it, but it make a lot of new errors in the IOUSBPipe.h now!!! All include in the IOUSBPipe.h cannot be found because all include declaration are searching in <IOKit/...> and not in <Kernel/IOKit/...>.
How can I use IOUSBPipe.h ??? Maybe I can't...
|
|
|
| |
|
|
|
 |
|
 |
|
Mac Enthusiast
Join Date: Feb 2000
Location: Storrs,Connecticut, USA
Status:
Offline
|
|
Well, I'm not a pro on how the IDE works but I do have an idea. You see, the valloc function is not prototyped anywhere but I can use it if I include the correct framework. Since you can include the kernel framework, why not try making your own header file and copying the contents of the IOKit headers into that. The way I'd guess that it works is that it might need a prototype for the function. For example, I know that if you write a function in assembly and want to call it in C you must declare the name global in assembly with an underscore preceding it ie .globl _myFunctionName Then you must prototype it in a header somewhere so the compiler knows what parameters it takes and returns. ie extern float myFunctionName(int);
I don't know about frameworks but I'd guess that maybe, if you include the framework as part of your project, then maybe all it needs is some prototypes in order to be able to use the functions. I'm not sure but it's worth a shot.
|
|
|
| |
|
|
|
 |
|
 |
|
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status:
Offline
|
|
All public frameworks should already have headers with prototypes for all the the functions you should call in them. You should then be able to include them with #import or #include <FrameworkName/Header>
This needs you to add the Framework to the Frameworks section in the file list, though.
I can't see any IOUSBPipe in my IOKit.framework, either. It looks like the Kernel.framework has a more complete implementation of IOKit. I might suggest you cp all the Kernel.framework/Headers/IOKit to IOKit.framework/Headers and see if that works. You might end up with symbol problems, though...
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|