2016-08-19 118 views
1

我在斯威夫特框架使用sockaddr_dl這樣進口的「if_dl.h」:「u_char」的聲明必須從模塊「Darwin.POSIX.sys.types」需要在它之前進口

module net [system] [extern_c] { 

    module if_dl { 
     umbrella header 
     "/Applications/Xcode_7.3.1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/net/if_dl.h" 
     module * {export *} 
    } 

} 

現在我得到這個錯誤:

Declaration of 'u_char' must be imported from module 'Darwin.POSIX.sys.types' before it is required

我試圖在類代碼中添加「導入達爾文」,但它不能解決問題。

回答

1

我解決了這個問題,

模塊「類型」必須在模塊內部「網」,它具有增加「if_dl」

module net [system] [extern_c] { 

    module types { 
     header "/usr/include/sys/types.h" 
     export * 
    } 

    module if_dl { 

     header 
     "/usr/include/net/if_dl.h" 
     export * 
    } 

} 
之前加入
相關問題