【发布时间】:2020-05-17 16:36:10
【问题描述】:
我在编译 C++ 源代码时遇到问题。该代码是键盘记录器。起初,我用 .cpp 保存,并尝试使用此命令从终端编译它
g++ test.cpp
然后终端向我显示了这条消息
test.cpp:1:10: fatal error: conio.h: No such file or directory
#include <conio.h>
^~~~~~~~~
compilation terminated.
还有这条消息
test.cpp:2:10: fatal error: windows.h: No such file or directory
#include <windows.h>
^~~~~~~~~~~
compilation terminated.
为了解决这个问题,我尝试使用 C++ IDE,code::blocks。从终端安装,并将键盘记录器源代码复制到 code:::blocks。但 IDE 显示此消息
||=== Build file: Debug in Belajar CPP (compiler: GNU GCC Compiler) ===|
/home/lucky/test.cpp|1|fatal error: conio.h: No such file or directory|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
我只是不知道如何解决这个问题以及如何在线搜索解决方案。因为我是使用 Linux-Mint 的新手。有人可以帮我解决这个问题吗?
【问题讨论】:
-
windows.hlinux 上不会有这个头文件。除非你正在使用 mingw 进行交叉编译。 -
conio.h用于 DOS。也许 Turbo C++ -
这意味着你可能无法构建你想要的东西。
-
在 Windows 上构建它或为您使用的任何平台查找键盘记录器。差不多就是这样。我会说移植代码,但我猜这可能超出了您当前的操舵室。
-
至于“如何在线搜索解决方案”,我在Stack Overflow的搜索框中输入了“conio.h No such file or directory”。
标签: c++ terminal compiler-errors codeblocks linux-mint