amnezia-vpn / amnezia-client

Amnezia VPN Client (Desktop+Mobile)
https://amnezia.org
GNU General Public License v3.0
5.78k stars 360 forks source link

[iOS/macOS] Build failed on Xcode 16.1 #1251

Open 2Grey opened 23 hours ago

2Grey commented 23 hours ago

There is compilation error while trying to build app on Xcode 16.1

Some errors in file WireGuardKitC.h:

        ^
WireGuardKitC.h:10:5: error: declaration of 'u_int32_t' must be imported from module 'DarwinFoundation.unsigned_types.u_int32_t' before it is required
    u_int32_t   ctl_id;
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.1.sdk/usr/include/sys/_types/_u_int32_t.h:30:33: note: declaration here is not visible
typedef unsigned int            u_int32_t;
                                ^
        ^
WireGuardKitC/WireGuardKitC.h:14:5: error: declaration of 'u_char' must be imported from module 'DarwinFoundation.unsigned_types.u_char' before it is required
    u_char      sc_len;
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.1.sdk/usr/include/sys/_types/_u_char.h:30:25: note: declaration here is not visible
typedef unsigned char   u_char;
                        ^
WireGuardKitC/WireGuardKitC.h:16:5: error: declaration of 'u_int16_t' must be imported from module 'DarwinFoundation.unsigned_types.u_int16_t' before it is required
    u_int16_t   ss_sysaddr;
    ^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.1.sdk/usr/include/sys/_types/_u_int16_t.h:30:41: note: declaration here is not visible
typedef unsigned short                  u_int16_t;
                                        ^

Desktop:

Versions:

Nethius commented 10 hours ago

try updating Qt to the latest version

2Grey commented 6 hours ago

Env

QT_VERSION=6.8.0
QT_IOS_BIN=.../amnezia-client/Qt/6.8.0/ios/bin
QT_MACOS_ROOT_DIR=.../amnezia-client/Qt/6.8.0/macos

$QT_IOS_BIN/qt-cmake . -B build-ios -GXcode -DQT_HOST_PATH=$QT_MACOS_ROOT_DIR
Output ``` Client iOS build Patching architectures for AmneziaVPN Patching architectures for SortFilterProxyModel Patching architectures for networkextension Patching architectures for qt6keychain Patching architectures for basic -- Configuring done (3.8s) -- Generating done (0.9s) -- Build files have been written to: .../amnezia-client/build-ios ```

xcodebuild \
-configuration Release \
-scheme AmneziaVPN \
-destination "generic/platform=iOS,name=Any iOS'" \
-project ./build-ios/AmneziaVPN.xcodeproj | xcbeautify
Output ``` ❌ .../amnezia-client/client/3rd/amneziawg-apple/Sources/WireGuardKitC/WireGuardKitC.h:10:5: declaration of 'u_int32_t' must be imported from module 'DarwinFoundation.unsigned_types.u_int32_t' before it is required u_int32_t ctl_id; ^ ❌ .../amnezia-client/client/3rd/amneziawg-apple/Sources/WireGuardKitC/WireGuardKitC.h:14:5: declaration of 'u_char' must be imported from module 'DarwinFoundation.unsigned_types.u_char' before it is required u_char sc_len; ^ ❌ .../amnezia-client/client/3rd/amneziawg-apple/Sources/WireGuardKitC/WireGuardKitC.h:16:5: declaration of 'u_int16_t' must be imported from module 'DarwinFoundation.unsigned_types.u_int16_t' before it is required u_int16_t ss_sysaddr; ^ ```