在wsl中遇到的“-- Detecting CXX compiler ABI info failed”问题解决

本文档指导如何通过编辑WSL配置文件wsl.conf,启用自动挂载功能,确保在Windows子系统Linux环境中,磁盘分区能自动挂载,避免因cmake或依赖包缺失引发的问题。
  • 前提:排除cmake和依赖包缺失引起的问题
  • 查看/etc/wsl.conf是否存在 ,若不存在,在/etc/目录下创建wsl.conf
$ wsl   #启动终端
$ cd /etc/ #进入etc目录
$ touch wsl.conf #创建wsl.conf文件
$ vim wsl.conf   # 打开wsl.conf

将代码段

[automount]
enabled = true
options = "metadata"`

写入wsl.conf保存后重新启动新终端

reference

project(Demo) cmake_minimum_required(VERSION 3.16.3) find_package(FFTW3) add_executable(Demo hunxiangcm2-24.cpp fftw3.h interp2.h app.h interp2.cpp) if(FFTW3_FOUND) include_directories(${FFTW3_INCLUDE_DIRS}) link_directories(${FFTW3_LIBRARY_DIRS}) target_link_libraries(Demo fftw3) #link_libraries(libfftw3.so) else(FFTW3_FOUND) message(FATAL_ERROR "FFTW3 library not found") endif(FFTW3_FOUND) 上面是我的CMakefile.txt,下面是我的run.bat cmake -B build2 cd build2 make export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib ./Demo 我在执行sudo sh run以后遇到报错 sjz18@Niwa:/mnt/d/WSL/reverb/reverb$ sudo sh run CMake Warning (dev) at CMakeLists.txt:1 (project): cmake_minimum_required() should be called prior to this top-level project() call. Please see the cmake-commands(7) manual for usage documentation of both commands. This warning is for project developers. Use -Wno-dev to suppress it. -- The C compiler identification is GNU 13.3.0 -- The CXX compiler identification is GNU 13.3.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Error at /usr/local/lib/cmake/fftw3/FFTW3Config.cmake:13 (include): include could not find requested file: /usr/local/lib/cmake/fftw3/FFTW3LibraryDepends.cmake Call Stack (most recent call first): CMakeLists.txt:4 (find_package) -- Configuring incomplete, errors occurred! make: *** No targets specified and no makefile found. Stop. run: 5: ./Demo: not found 请问怎么解决
03-13
WSL中编译C程序出现编译警告 root@DESKTOP-2QBDJV0:/mnt/d/work/openeuler_env/code/testUsbDongleRFID_pro# ./script/build.sh -- The C compiler identification is GNU 10.3.1 -- The CXX compiler identification is GNU 10.3.1 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /mnt/d/work/openeuler_env/oecore-x86_64/sysroots/x86_64-peesdk-linux/usr/bin/aarch64-powereuler-linux-gcc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /mnt/d/work/openeuler_env/oecore-x86_64/sysroots/x86_64-peesdk-linux/usr/bin/aarch64-powereuler-linux-g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done -- Generating done -- Build files have been written to: /mnt/d/work/openeuler_env/code/testUsbDongleRFID_pro/build make: Warning: File 'Makefile' has modification time 0.31 s in the future make[1]: Warning: File 'CMakeFiles/Makefile2' has modification time 0.28 s in the future make[2]: Warning: File 'CMakeFiles/run_testUsbDongleRFID.dir/flags.make' has modification time 0.21 s in the future make[2]: warning: Clock skew detected. Your build may be incomplete. make[2]: Warning: File 'CMakeFiles/run_testUsbDongleRFID.dir/flags.make' has modification time 0.17 s in the future [ 50%] Building C object CMakeFiles/run_testUsbDongleRFID.dir/main.c.o /mnt/d/work/openeuler_env/code/testUsbDongleRFID_pro/main.c: In function 'main': /mnt/d/work/openeuler_env/code/testUsbDongleRFID_pro/main.c:121:5: warning: ignoring return value of 'write' declared with attribute 'warn_unused_result' [-Wunused-result] 121 | write(fd, command, strlen(command)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [100%] Linking C executable run_testUsbDongleRFID make[2]: warning: Clock skew detected. Your build may be incomplete. [100%] Built target run_testUsbDongleRFID make[1]: warning: Clock skew detected. Your build may be incomplete. make: warning: Clock skew detected. Your build may be incomplete.
06-12
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值