Why can <net / route.h> be enabled and compiled into the IOS6.1 simulator until it can be compiled into a real iphone?
I tried to enable gateway selection to complete the problem. While compiling the xcode IOS simulator, it can be turned on, however, it cannot on the real IOS machine. I can only put a copy of route.h in the project and it really works on a real machine. But this is another problem in the simulator. It says that structures such as rt_metrics, rtstat are redefined, with information: "The definition of" struct rt_metricx "must be imported from the module" Darwin.net.route "before it is needed." How can I solve this problem? These are the header files that I have included in my file.
#include "route.h"
//#include <net/route.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <sys/sysctl.h>
#include <string.h>
#include <net/if.h>
#include <ifaddrs.h>
#include <net/if_dl.h>
#include "resolv.h"
+2