O-H-M2/qmk_port_ch582

关于编译的时候出现的问题

Closed this issue · 4 comments

你好 , 我在实现移植的代码编写的时候遇到一些问题 由于是新手的原因)在使用vs2020对项目进行cmake的过程中出现了报错 报错代码如下
Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe - broken
1> [CMake] CMake Error at C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message):
1> [CMake] The C compiler
1> [CMake]
1> [CMake] "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe"
1> [CMake]
1> [CMake] is not able to compile a simple test program.
1> [CMake]
1> [CMake] It fails with the following output:
1> [CMake]
1> [CMake] Change Dir: G:/port_qmk/out/build/x64-Debug/CMakeFiles/CMakeTmp
1> [CMake]
1> [CMake] Run Build Command(s):C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe cmTC_185a4 && [1/2] Building C object CMakeFiles\cmTC_185a4.dir\testCCompiler.c.obj
1> [CMake] 用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.31.31107 版
1> [CMake] 版权所有(C) Microsoft Corporation。保留所有权利。
1> [CMake]
1> [CMake] cl: 命令行 warning D9035 :“o”选项已否决,并将在将来的版本中移除
1> [CMake] testCCompiler.c
1> [CMake] [2/2] Linking C static library libcmTC_185a4.a
1> [CMake] FAILED: libcmTC_185a4.a
1> [CMake] cmd.exe /C "cd . && "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E rm -f libcmTC_185a4.a && C:\PROGRA1\MIB0551\2022\COMMUN1\VC\Tools\MSVC\14311.311\bin\Hostx64\x64\lib.exe qc libcmTC_185a4.a CMakeFiles\cmTC_185a4.dir\testCCompiler.c.obj && cd ."
1> [CMake] Microsoft (R) Library Manager Version 14.31.31107.0
1> [CMake] Copyright (C) Microsoft Corporation. All rights reserved.
1> [CMake]
1> [CMake] LINK : fatal error LNK1181: 无法打开输入文件“qc”
1> [CMake] ninja: build stopped: subcommand failed.
不知道有没有相关的编译教程呢,感谢

仓库尚未完工,所以没有编译教程。我也不使用Windows和任何IDE,但我会尽力提供帮助。

看起来你像是选用了错误的编译器,1> [CMake] 用于 x64 的 Microsoft (R) C/C++ 优化编译器 19.31.31107 版 看起来像是编译Windows平台的应用程序用的,你应该使用riscv编译器。

好的 十分感谢 我现在转用unix平台 尝试使用riscv编译器试试看

你好 我在编译的时候发现如下错误
[ 15%] Building C object CMakeFiles/qmk_port_ch582.elf.dir/qmk_firmware/quantum/bootmagic/bootmagic_lite.c.obj
In file included from /home/qmk/桌面/port_qmk/qmk_porting/../qmk_firmware/quantum/quantum.h:18,
from /home/qmk/桌面/port_qmk/qmk_firmware/quantum/bootmagic/bootmagic_lite.c:16:
/home/qmk/桌面/port_qmk/qmk_porting/platforms/ch58x/platform_deps.h:22:10: fatal error: ble.h: No such file or directory
22 | #include "ble.h"
| ^~~~~~~
compilation terminated.
CMakeFiles/qmk_port_ch582.elf.dir/build.make:236: recipe for target 'CMakeFiles/qmk_port_ch582.elf.dir/qmk_firmware/quantum/bootmagic/bootmagic_lite.c.obj' failed
貌似是在相对应文件夹下的ble.h文件缺失了 看了仓库貌似也确实没有 这个文件可以通过ch官方的环境获得吗 还是确实没有完成呢

ble和2.4g都在施工中。所有需要的文件都已包含在sdk文件夹下,不依赖任何wch的环境。

可以尝试在rules.cmake文件中将
set(BLE_ENABLE ON CACHE BOOL "KB" FORCE)
改为
set(BLE_ENABLE OFF CACHE BOOL "KB" FORCE)
禁用ble。

记得打开usb。