首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Eclipse不会在Windows中编译.exe (C++)

Eclipse不会在Windows中编译.exe (C++)
EN

Stack Overflow用户
提问于 2020-06-21 07:50:48
回答 1查看 160关注 0票数 0

我已经对此做了大量的研究,但我无法弄清楚。我在一个团队中,我们都编写了自己的代码,现在,我们的一个团队成员正在将我们所有的代码编译为一个文件。我的代码不允许他编译.exe。我也遇到过同样的问题。这在Code::Blocks中对我来说都是有效的;但是,我们使用的是Eclipse。我们使用MinGW作为编译器,我将PE64 Windows解析器设置为二进制解析器。

我已经用C++17文件系统库替换了Boost文件系统库,不幸的是,结果是一样的。在我的故障排除过程中,我创建了一个hello,world程序,其中包含了我正在使用的所有库。在这种情况下,不会创建可执行文件。然后,我删除了我正在使用的所有库。在该实例中,创建了一个可执行文件。我怀疑在某些方面找不到libcurl-x64.dll,这就是为什么不构建可执行文件的原因。我已经在包含文件夹中查找了重复的文件名。一个都不存在。我的构建日志如下:

代码语言:javascript
复制
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中的完整构建日志是:

代码语言:javascript
复制
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.
EN

回答 1

Stack Overflow用户

发布于 2020-06-21 07:55:37

如果您有编译问题,也可以使用WSL terminal

安装并设置linux终端后,运行以下命令

代码语言:javascript
复制
$sudo apt update
$sudo apt install g++
$sudo apt install gcc

将目录更改为eclipse工作目录并运行g++命令。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62492995

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档