Eclipse 没有在 Windows (C++) 中编译.exe
Eclipse is not compiling an .exe in Windows (C++)
我对此做了很多研究,但我无法弄清楚。我所在的团队都编写了各自的代码,现在,我们的一名团队成员正在努力将所有代码编译为一个文件。我的代码不允许他编译.exe。我遇到了同样的问题。这一切都在代码::块中对我有用;但是,我们正在使用 Eclipse。我们使用MinGW作为编译器,我将PE64 Windows解析器设置为二进制解析器。
我已经用 C++17 文件系统库替换了 Boost 文件系统库,不幸的是,结果是一样的。在我的故障排除过程中,我创建了一个hello,world程序,其中包含我正在使用的所有库。在这种情况下,未创建可执行文件。然后我删除了我正在使用的所有库。在该实例中,创建了一个可执行文件。我怀疑在某些方面找不到libcurl-x64.dll,这就是不会构建可执行文件的原因。我已经在包含文件夹中查找了重复的文件名。没有一个存在。我的构建日志如下:
19:34:27 **** Rebuild of configuration Debug for project Ethical-Hacking-with-Computer-Viruses-Using-C++ ****
Info: Internal Builder is used for build
g++ -std=c++17 "-IC:\libraries5\xlnt-master\include" "-IC:\libraries5\curl-7.70.0-win64-mingw\include" -O2 -g3 -Wall -c -fmessage-length=0 -o main.o "..\main.cpp"
g++ "-LC:\thirdparty" -static -l -o Ethical-Hacking-with-Computer-Viruses-Using-C++.exe main.o
g++: error: Ethical-Hacking-with-Computer-Viruses-Using-C++.exe: No such file or directory
19:34:29 Build Finished. 0 errors, 0 warnings. (took 2s.26ms)
我将非常感谢在创建可执行文件方面的任何帮助。谢谢。
编辑:按照朱利安的要求,我已经上传了我的制作文件。
https://www.dropbox.com/s/3c11vnccjah3frx/makefile?dl=0
使用 GNU Make 时,我在 Eclipse 中的完整构建日志是:
21:09:58 **** Build of configuration Debug for project Ethical-Hacking-with-Computer-Viruses-Using-C++ ****
make all
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -std=c++17 -I"C:libraries5xlnt-masterinclude" -I"C:libraries5curl-7.70.0-win64-mingwinclude" -O2 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.o" -o "main.o" "../main.cpp"
Finished building: ../main.cpp
Building target: Ethical-Hacking-with-Computer-Viruses-Using-C++.exe
Invoking: MinGW C++ Linker
g++ -L"C:thirdparty" -static -l -o "Ethical-Hacking-with-Computer-Viruses-Using-C++.exe" ./main.o
g++.exe: error: Ethical-Hacking-with-Computer-Viruses-Using-C++.exe: No such file or directory
makefile:44: recipe for target 'Ethical-Hacking-with-Computer-Viruses-Using-C++.exe' failed
make: *** [Ethical-Hacking-with-Computer-Viruses-Using-C++.exe] Error 1
"make all" terminated with exit code 2. Build might be incomplete.
如果遇到编译问题,还可以使用 WSL 终端。
安装并设置 Linux 终端后,运行以下命令
$sudo apt update
$sudo apt install g++
$sudo apt install gcc
将目录更改为 eclipse 工作目录并运行 g++ 命令。
相关文章:
- VSCode C++ 编译的exe感染了Win32:TrojanX-gen[Trj]
- Eclipse 没有在 Windows (C++) 中编译.exe
- 在VS Code中编译C / C ++时如何禁用自动创建EXE文件?
- 为什么我可以在EXE上编译DLL
- 无论如何可以将webm / mp4文件编译/记忆为.exe程序吗?(C++)
- C++程序编译器在使用g++命令编译后自动运行exe文件
- 如何在 Azure 应用服务中使用 cl.exe 编译 C++ 代码并生成可执行文件
- CMake 和 Visual Studio 2015 - C 编译器 cl.exe 无法编译简单的测试程序
- C++编译器 g++.exe 无法编译简单的测试程序 - 确定 CXX 编译器是否工作失败
- 是否可以将Visual Studio 2017将C 代码编译到EXE以外的文件类型中
- 编译C++代码以.EXE返回双精度
- 将32位和64位应用程序(具有相同代码)编译为一个EXE
- MinGW编译的exe-缺少libgcc_s_silj-1.dll
- Visual Studio 2015 无法编译.exe
- CL.EXE无法编译简单的测试程序VS2017
- 如何使用x64编译器使用MsBuild.exe编译大型c++项目
- 通过 cmd 将参数传递给C++编译的 exe
- 如何修复错误:g++.exe:无法使用-c或-S和多个编译指定-o
- 如何在 Atom IDE 中使用 gpp-compiler 时更改 MinGW 编译的 exe 位置?
- Eclipse CDT - 如何在外部控制台 (cmd.exe) 中运行编译.exe