Skip to content
This repository has been archived by the owner on Apr 27, 2024. It is now read-only.

xmake编译失败 #1

Open
sonneImmer opened this issue Jun 13, 2023 · 1 comment
Open

xmake编译失败 #1

sonneImmer opened this issue Jun 13, 2023 · 1 comment

Comments

@sonneImmer
Copy link

本机环境gcc版本为11.3.0,clang版本为11.0.0
git clone到本地后,进入文件夹执行xmake命令,出现如下报错信息

[ 8%]: cache compiling.release src/Ayan.cpp
[ 8%]: cache compiling.release src/core/bot.cpp
[ 8%]: cache compiling.release src/core/env.cpp
[ 8%]: cache compiling.release src/core/service.cpp
error: src/core/service.h:421:84: error: to refer to a type member of a template parameter, use ‘typename MixFirst::TargetEvent’ [-fpermissive]
421 | if constexpr (std::is_same<MixFirst::TargetEvent, E>())
| ^
src/core/service.h: In member function ‘bool ayan::MixinService::_wake_impl(ayan::Bot&, E&)’:
src/core/service.h:431:84: error: to refer to a type member of a template parameter, use ‘typename MixFirst::TargetEvent’ [-fpermissive]
431 | if constexpr (std::is_same<MixFirst::TargetEvent, E>())
| ^
src/core/service.h: In member function ‘bool ayan::MixinService::_sleep_impl(ayan::Bot&, E&)’:
src/core/service.h:441:84: error: to refer to a type member of a template parameter, use ‘typename MixFirst::TargetEvent’ [-fpermissive]
441 | if constexpr (std::is_same<MixFirst::TargetEvent, E>())
| ^
src/core/service.h: In member function ‘bool ayan::MixinService::_trig_impl(ayan::Bot&, E&)’:
src/core/service.h:451:84: error: to refer to a type member of a template parameter, use ‘typename MixFirst::TargetEvent’ [-fpermissive]
451 | if constexpr (std::is_same<MixFirst::TargetEvent, E>())
| ^
src/core/service.h: In member function ‘bool ayan::MixinService::_act_impl(ayan::Bot&, E&)’:
src/core/service.h:461:84: error: to refer to a type member of a template parameter, use ‘typename MixFirst::TargetEvent’ [-fpermissive]

in src/Ayan.cpp
warning: add_cxxflags("-fconcept") is ignored, please pass {force = true} or call set_policy("check.auto_ignore_flags", false) if you want to set it.

请问我这个地方是哪里出了问题呀?是gcc版本不支持的原因么?还是clang没配置好的问题呀?

@Guo-Shiyu
Copy link
Owner

目测是使用了 master 分支的源文件, 同时你的 default CC 是 clang。 clang 11.0 未经过测试, 可能无法满足最低编译器版本要求。

  1. 切换到 dev 分支, 执行xmake 进行编译, 如果失败
  2. 设置 xmake.luaAyanConfig.Compilation.ToolChain 值为 "gcc", 重新使用 xmake 命令进行编译。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants