gpt4 book ai didi

当我在 CLion 2020.3 上使用远程工具链时,cmake 无法解析本地路径

转载 作者:行者123 更新时间:2023-12-04 13:54:11 56 4
gpt4 key购买 nike

/usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/usr/bin/make -DCMAKE_C_COMPILER=/usr/lib/llvm/11/bin/clang -DCMAKE_CXX_COMPILER=/usr/lib/llvm/11/bin/clang++ -G "CodeBlocks - Unix Makefiles" /home/a_user_name/CLion_Programmes/VM_D
-- Configuring done
-- Generating done
-- Build files have been written to: /home/a_user_name/CLion_Programmes/VM_D/cmake-build-debug
Cannot resolve path: D:\MyProgrammes\CL\VM_D\cmake-build-debug
[Failed to reload]
客户端:Windows 10 20H2
主机:Hyper-V 上的 Gentoo Linux
通过openssh连接
当我设置我的环境时,我使用了这个:
https://www.jetbrains.com/help/clion/remote-projects-support.html\

感谢帮助 :)

最佳答案

服务器上的tar文件创建好像有问题。 FileTransfer 窗口中是否有任何错误消息?你能检查一下 tar 文件是否是在你的/tmp 文件夹中创建的吗?
我使用了 https://youtrack.jetbrains.com/issue/CPP-17421#focus=Comments-27-4040675.0-0 中描述的 tar 包装器并且它不适用于当前版本,因此未创建导致该错误消息的 tar 文件。
我按如下方式修复了 tar 包装器:

#!/bin/bash

# Uncomment this line to get details about files beeing transfered
#TAR_LOGFILE=~/.clion_tar_calls.txt

redirect_cmd() {
if [[ ! -z ${TAR_LOGFILE} ]]; then
echo "Executing tar: $@" >> ${TAR_LOGFILE}
"$@" >> ${TAR_LOGFILE}
else
"$@" > /dev/null
fi
}

if [[ ! -z ${TAR_LOGFILE} ]]; then
echo "`date` Called tar at $PWD with parameters: $@" >> ${TAR_LOGFILE}
if [[ "$*" == *--files-from* ]]; then
files=$(echo "$@" | sed 's/.*--files-from=\([^[:space:]]*\).*/\1/')
cat ${files} >> ${TAR_LOGFILE}
fi
fi

if [[ $PWD =~ cmake-build- ]]; then
excludes=('--exclude=*.o' '--exclude=*.gcno' '--exclude=*.gcda' '--exclude=*.a' '--exclude=bin' '--exclude=lib')

first="$1"
shift
file="$1"
shift
redirect_cmd exec /bin/tar "$first" "$file" "${excludes[@]}" "$@" --verbose
else
exec /bin/tar "$@"
fi

关于当我在 CLion 2020.3 上使用远程工具链时,cmake 无法解析本地路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65615454/

56 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com