I try to run pod lib lint in a Cocoa Framework swift project and return the following error:
- ERROR | [iOS] xcodebuild: /MyProject/route.h:164:8: error: redefinition of 'rt_msghdr2'
- NOTE | [iOS] xcodebuild: /Applications/Xcode.app/Contents/Developer/Platforms
/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator10.3.sdk
/usr/include/net/route.h:164:8:
note: previous definition is here
I have an Objective-C class (NetworkUtil.h - NetworkUtil.m) with the following import structure.
#if TARGET_IPHONE_SIMULATOR
#include <net/route.h>
#else
#include "route.h"
#endif
This is because the route.h file exists only in the iOS Simulator SDK, but not in the real iOS SDK ( https://stackoverflow.com/a/1684075/ ... ). I check if this is an iPhone simulator, so the original <net / route.h> will be imported, or it works on a real iPhone, in this case it gets my manually copied "route.h".
Xcode , xcodebuild, pod lib lint, . - < net/route.h > 'route.h', #if_TARGET_IPHONE_SIMULATOR - " ".
- ?