我已经对此做了大量的研究,但我无法弄清楚。我在一个团队中,我们都编写了自己的代码,现在,我们的一个团队成员正在将我们所有的代码编译为一个文件。我的代码不允许他编译.exe。我也遇到过同样的问题。这在Code::Blocks中对我来说都是有效的;但是,我们使用的是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)我将非常感谢在创建可执行文件方面的任何帮助。谢谢。
编辑:应Julian的要求,我已经上传了我的makefile。
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:\libraries5\xlnt-master\include" -I"C:\libraries5\curl-7.70.0-win64-mingw\include" -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.发布于 2020-06-21 07:55:37
如果您有编译问题,也可以使用WSL terminal。
安装并设置linux终端后,运行以下命令
$sudo apt update
$sudo apt install g++
$sudo apt install gcc将目录更改为eclipse工作目录并运行g++命令。
https://stackoverflow.com/questions/62492995
复制相似问题