Re: Using SystemConfiguration API inside KEXT
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Le 11 mai 2010 à 18:32, John B Brown a écrit :
Dear Jean-Daniel,
The directive was very specific;
"<SystemConfiguration/SystemConfiguration.h>"
which means if such a specific LOCATION does not exist the header file will NOT be found no matter where in the /Developer tree, or even in ANY tree, 'SystemConfiguration.h' might be.
Computers only do what they are told. They can not magically know what you "really" want.
Try to following: Create a text file (include.c for example) with the following text: ------------------------------------------------ include.c #include <SystemConfiguration/SystemConfiguration.h> int main(int argc, char **argv) { } ------------------------------------------------------------ Now, just try the following command on it: gcc include.c And see that even if a compiler cannot magically find the header, it successfully compiles this file. There is nothing magic here, as I said earlier, this syntax in the only valid syntax to include a framework header. If you want to know what a framework is and how to use it, just read the doc: http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPFra... Regards -- Jean-Daniel
Shalom,
John B. Brown. [jbb@vcn.com] 358 High Street, Buffalo, Wyoming 82834
"Freedom is not worth having if it does not include the freedom to make mistakes" Mahatma Gandhi "If any question why we died, tell them, because our fathers lied." Rudyard Kipling "A man who does not know the truth is just an idiot but a man who knows the truth and calls it a lie is a crook." Bertolt Brecht "I wonder whether the world is being run by smart people who are putting us on or by imbeciles who really mean it." Mark Twain
On 5/11/10 10:18 AM, Jean-Daniel Dupas wrote:
Le 11 mai 2010 à 18:11, John B Brown a écrit :
Unless you have a sub-directory under /usr/include/ called /usr/include/SystemConfiguration/ your call will not find any files in that directory using #include<SystemConfiguration/SystemConfiguration.h> as the #include directive.
We are talking about Mac OS X development. AFAIK, all Mac OS X compilers know how to handle a framework and know how to find a header in a Framework bundle. This include directive is perfectly valid, or would be if it was an user space program, but Kernel Extension can't use user space framework, so whatever (useless) compiler flag you add, it will not works.
-- Jean-Daniel
On my machine running Mac OS 10.6.3 and Xcode 3.2.2 the only files SystemConfiguration.h are in sub-directories "Headers" in all cases, not in any sub-directory "SystemConfiguration."
Use findutils! Set your #include accordingly. It might help also to use '-I"some tree"' in your C flags to the compiler, like
-I/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks\/SystemConfiguration.framework/Versions/A/Headers
or wherever 'locate SytemConfiguration.h' finds that you like and that is found on your system.
You might have to go to [ftp://ftp.gnu.org/gnu/] to find a real working source for findutils; the piece of crap Apple gives you in their system load is just that, a piece of crap. You have practically zero control over what it finds when their version of 'updatedb' runs. Needless to say, updatedb does NOT exist in your path so you must go to some considerable trouble to run it whenever you wish.
By the way, is your NKE a sneaker control, a navigation system, or some sort of motion detector?
On 5/11/10 9:11 AM, Andy Huang wrote:
Hi,
I am developing a NKE. Now I need to call SystemConfiguration framework API to find primary interface. When I tried to include <SystemConfiguration/SystemConfiguration.h>, I always get compiliation error saying not able to find the header file. Any ideas? TIA.
_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Jean-Daniel Dupas