【发布时间】:2021-03-28 20:35:34
【问题描述】:
我刚切换到 ubuntu,我想为 CPP 设置 notepad++。
所以我使用NppExec插件在notepad++中编译,
我的脚本是:
npp_save
g++ "$(FULL_CURRENT_PATH)" -o "$(CURRENT_DIRECTORY)\$(NAME_PART)obj"
./"$(NAME_PART)obj"
这里我使用的“obj”只是用“obj”关键字保存文件。
最后一行./"$(NAME_PART)obj"是运行程序。
但它看起来在 ubuntu 中不起作用,它会产生这个错误:
NPP_SAVE: Z:\home\username\cpp\test.cpp
g++ "Z:\home\username\cpp\test.cpp" -o "Z:\home\username\cpp\testobj"
; about to start a child process: "g++ "Z:\home\username\cpp\test.cpp" -o "Z:\home\username\cpp\testobj"
CreatProcess() failed with error code 2:
File not found.
./"testobj"
; about to start a child process: "./"testobj""
CreatProcess() failed with error code 2:
File not found.
我调查了一些我认为是问题的地方,所以我认为是/ 和\ 在更改目录时的用法。
我不知道如何解决这个问题,所以我不能确定。
有什么想法吗? :) 我在同一台机器上使用 vim btw,它运行良好。
【问题讨论】:
-
您可以尝试删除
"。在linux中没用,文件名中没有空格 -
你的路径上有 g++ 吗?
-
@Damien 您绝对可以在 Linux 上的文件名中包含空格,并且可以将它们用引号括起来以防止错误
-
@AlanBirtles 我一直读到不建议在 linux 文件名中使用空格。这并不意味着根本不允许这样做。几十年来,我一直在 Linux 和 Windows 之间交换文件,在解决未解决的问题后,我很久以前就决定避免使用空格。我什至在 Windows 中遇到了问题!也许最近的 linux 系统更有弹性。
-
@Damien 他们在 Windows 上造成的问题不会多或少
标签: c++ linux ubuntu notepad++