如何在 Windows 命令提示符下使用 Dev C++ 编译器编译 c++ 程序
How to compile a c++ program using Dev C++ compiler in windows command prompt?
我在Windows中安装了Dev C++,并使用了该IDE,但是我想在Windows命令提示符下编译我的程序prog1.cpp
。我在当前目录中打开了cmd,并尝试了以下命令不起作用:
- CL 计划1.cpp
- CC 程序 1.cpp
- GCC Prog1 Prog1.cpp
- g++ -o prog1 prog1.cpp
- C 程序 1.cpp
- cl/EHsc prog1.cpp
上述所有命令都会导致此错误:command not recognized as an internal or external command, operable program or batch file.
:
注意:我不想安装 Visual Studio 并使用cl /EHsc prog1.cpp
使用 Dev C++编译器在 cmd 中编译程序的命令是什么?
Dev-C++ 不是编译器。这是一个 IDE。
您需要先将路径添加到编译器,然后才能使用它们。
假设您安装了 Dev-C++ 到 C:Program FilesDev-Cpp
,那么您需要将以下路径添加到变量%PATH%
:
C:Program FilesDev-CppMinGW64bin
C:Program FilesDev-CppMinGW64libexecgccmingw326.3.0
C:Program FilesDev-CppMinGW64mingw32bin
您可以将其临时添加到一个命令提示符会话中
path %PATH%;<more paths here>
或者参考谷歌了解如何将其永久添加到您的系统中。
解决%PATH%
问题后,您将能够使用 gcc
(C( 或 g++
(C++( 编译程序。请注意,c
和 cl
仍然不可用(因为它们未安装(。
相关文章:
- 请发现它在 dev 中工作的错误,但在 hackerrank 中不起作用
- 无法在 dev-c++ 上编译程序?
- Dev c++ mingw 不再编译
- 如何在 Windows 上将bcrypt_gensalt与 /dev/urandom 一起使用?
- 我正在使用dev c ++,但收到错误(C++98'array'必须由构造函数初始化)
- dev Wx Dev C++ vs Graphics.h?
- dev如何在C++中比较二进制数
- 在linux中为c++dev配置VSCode
- DEV C++ 第 69 行 [错误] ISO "for" 范围更改了"i"的名称查找 [-允许]
- dev在试图从dev c++mingw 4.8.1中的文件读取时接收分段错误
- 我有一个C++函数,它在Dev C++中编译,但在G++中不编译
- 写入/dev/ttyS0后读取0字节
- 如何将 stderr 重定向到 /dev/null
- 如何创建C++DLL(使用DEV -C++)并在MT4脚本中使用(逐步)
- auto 关键字在 Dev c++ 中不起作用
- 从 win 7 升级到 Win 10 后,出现 Dev-C++ makefile.win 编译错误
- 如何检测 ofstream 是否正在写入 /dev/null
- 如何将 libproxy-dev 链接到现有的 cmake 项目(C++)?
- 在哪里调用主函数(dev c ++)
- mmap with /dev/input/event*