Skip to content

mac电脑默认创建tbox consol工程编译失败 #829

@linuxsky

Description

@linuxsky

电脑mac os
1、创建tbox工程
$ xmake create -l c -t tbox.console hello_tbox
create hello_tbox ...
[+]: xmake.lua
[+]: src/xmake.lua
[+]: src/main.c
[+]: .gitignore
create ok!
2、编译工程

shiyang @ MacBook-Pro in ~/workspace/github/hello_tbox [16:14:49]

$ xmake -r -v
checking for the architecture ... x86_64
checking for the Xcode directory ... /Applications/Xcode.app
checking for the SDK version of Xcode ... 10.15
checking for the Codesign Identity of Xcode ... no
checking for the unzip ... /usr/bin/unzip
checking for the git ... /usr/local/bin/git
checking for the gzip ... /usr/bin/gzip
checking for the tar ... /usr/bin/tar
checking for the ping ... /sbin/ping
pinging for the host(gitee.com) ... 28 ms
checking for the nmap ... no
pinging for the host(gitlab.com) ... 65535 ms
pinging for the host(github.com) ... 65535 ms
checking for the xmake::tbox ... no
checking for the brew ... /usr/local/bin/brew
checking for the vcpkg directory ... no
checking for the pkg-config ... /usr/local/bin/pkg-config
checking for the tbox ... ok
configure
{
arch = x86_64
ccache = true
xcode = /Applications/Xcode.app
target_minver = 10.15
ndk_stdcxx = true
host = macosx
kind = static
buildir = build
xcode_sdkver = 10.15
plat = macosx
mode = release
}
checking for the xcrun -sdk macosx clang++ ... /usr/bin/xcrun -sdk macosx clang++
checking for the linker (ld) ... xcrun -sdk macosx clang++
checking for the xcrun -sdk macosx clang ... /usr/bin/xcrun -sdk macosx clang
checking for the c compiler (cc) ... xcrun -sdk macosx clang
checking for the /usr/bin/xcrun -sdk macosx clang ... ok
checking for the flags (-O3) ... ok
checking for the flags (-Wno-error=deprecated-declarations) ... ok
checking for the flags (-fno-strict-aliasing) ... ok
checking for the ccache ... no
[ 50%]: compiling.release src/main.c
"/usr/bin/xcrun -sdk macosx clang" -c -fvisibility=hidden -Wall -Werror -O3 -std=c99 -D__tb_prefix__="hello_tbox" -Wno-error=deprecated-declarations -fno-strict-aliasing -Qunused-arguments -arch x86_64 -mmacosx-version-min=10.15 -isysroot /Applications/Xcode.app/Contents/Developer/platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -o build/.objs/hello_tbox/macosx/x86_64/release/src/main.c.o src/main.c
checking for the flags (-MMD -MF) ... ok
checking for the flags (-fcolor-diagnostics) ... ok
error: clang: error: no such sysroot directory: '/Applications/Xcode.app/Contents/Developer/platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk' [-Werror,-Wmissing-sysroot]

shiyang @ MacBook-Pro in ~/workspace/github/hello_tbox [16:14:54] C:255

$ ls /Applications/Xcode.app/Contents/Developer/platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk
ls: /Applications/Xcode.app/Contents/Developer/platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk: No such file or directory

3、目录可以看到存在

shiyang @ MacBook-Pro in ~/workspace/github/hello_tbox [16:15:12] C:1

$ ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/
Entitlements.plist Library SDKSettings.json SDKSettings.plist System usr

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions