Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
linuxsky opened this issue Jun 8, 2020 · 7 comments
Closed

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

linuxsky opened this issue Jun 8, 2020 · 7 comments
Labels
Milestone

Comments

@linuxsky
Copy link

linuxsky commented Jun 8, 2020

电脑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

@linuxsky
Copy link
Author

linuxsky commented Jun 8, 2020

xmake 版本号
$ xmake --version
xmake v2.3.4+202006081609, A cross-platform build utility based on Lua
Copyright (C) 2015-2020 Ruki Wang, tboox.org, xmake.io
_
__ ___ __ __ __ | | ______
\ / / | / |/ _ | |/ / __
> < | _
/ | /| | < /
/
/__|
| |
|_
||____|
by ruki, tboox.org

👉  Manual: https://xmake.io/#/getting_started
🙏  Donate: https://xmake.io/#/sponsor

@waruqi
Copy link
Member

waruqi commented Jun 8, 2020

$ 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、目录可以看到存在

ls 都报 No such file or directory了,你是从哪判断目录还是存在的

@linuxsky
Copy link
Author

linuxsky commented Jun 8, 2020

$ 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、目录可以看到存在

ls 都报 No such file or directory了,你是从哪判断目录还是存在的

$ ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/

DriverKit19.0.sdk MacOSX.sdk MacOSX10.15.sdk

@waruqi
Copy link
Member

waruqi commented Jun 8, 2020

是因为我这是 大小写不敏感文件系统,。 Platforms 目录 是 platforms也ok,所以你这大小写敏感的文件系统下,就会导致 Developer/platforms 目录找不到

你更新到dev版本,我修复了,xmake update -s dev

@waruqi waruqi added the bug label Jun 8, 2020
@waruqi waruqi added this to the v2.3.5 milestone Jun 8, 2020
@linuxsky
Copy link
Author

linuxsky commented Jun 8, 2020

是因为我这是 大小写不敏感文件系统,。 Platforms 目录 是 platforms也ok,所以你这大小写敏感的文件系统下,就会导致 Developer/platforms 目录找不到

你更新到dev版本,我修复了,xmake update -s dev

更新后解决了,但是编译还是失败,是不是默认生成工程的 include 路径没有添加

image

@waruqi
Copy link
Member

waruqi commented Jun 8, 2020

为啥还装到系统/usr下了。。既然用 tbox.console模板创建的 就不要走系统了

系统的删了,然后执行

xmake f -c -vD
xmake -vD

给我看下输出

@linuxsky
Copy link
Author

linuxsky commented Jun 8, 2020

为啥还装到系统/usr下了。。既然用 tbox.console模板创建的 就不要走系统了

系统的删了,然后执行

xmake f -c -vD
xmake -vD

给我看下输出

删除系统的,然后清除工程并更新到最新xmake ok了

@linuxsky linuxsky closed this as completed Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants