I have created a simple iOS program that compiles without a hitch and runs great on an iPad simulator. The same program cannot be compiled when I tell XCode 4 to use my attached iPad device. The problem appears to be that several header files cannot be located when I try to use the attached iPad.
Here are the header files that cannot be located on the iPad device (this is excerpted from the relevant include statements):
#include <sys/socketvar.h>
#include <netinet/tcp_fsm.h>
#include <netinet/tcp_var.h>
So, for example, the error messages I'm getting are similar to
Sys/socketvar.h: No such file or directory
Please don't be side-tracked by the file names...I'm doing some rather low-level socket-related things in my program and was unable to utilize higher-level APIs provided by Apple.
My question is: what gives? I.e., why am I able to run this progr开发者_StackOverflow中文版am (utilizing the three header files noted above) on an iPad simulator, but not an actual iPad? Also, is there some other location at which these header files can be referenced on a physical iOS device?
Thanks for the feedback--the solution was to simply spend some time walking the header file dependencies and manually recreate the missing files. In the end, there were seven (not the end of the world to wrangle by hand) and my program compiles and executes without a hitch on both an iPad simulator and physical device.
I would definitely prefer better parity between the header files available on a physical iOS device and the simulators, though! To be fair, however, I may be in a very small subset of developers who actually need to work with such low-level networking APIs.
精彩评论