这段代码有什么问题,gcc不会将其转换为.exe
What is wrong with this piece of code that gcc will not convert it to .exe
我似乎找不到这个问题的答案,我想是因为它太开放了。
我目前正在学习c++与一个傻瓜的书。这本书有点旧了(2001年),但仍然很有帮助。我正忙着处理这段代码,我试着用gcc -o conversion conversion.cpp
行在cmd中转换它(我的文件叫做conversion)。
当我试图转换它时,它在长文本的末尾说:
failed: invalid operation
collect2.exe: error: ld returned 1 exit status
这是我的代码:
#include <stdio.h>
#include <iostream>
using namespace std;
int main(int arg, char* pszArgs[])
{
int loopCount;
cout << "Enter the amount of loops: ";
cin >> loopCount;
while (loopCount > 0)
{
loopCount = loopCount - 1;
cout << "Still " << loopCount << " to go/n";
return 0;
}
}
请帮忙,我想知道出了什么问题。我到处都找不到……
用g++
编译c++程序,不能用gcc
。
相关文章:
- 为cl.exe(Visual Studio代码)指定命令行C++版本
- CMake项目Boost库错误:Boost/config/compiler/gcc.hpp:165:10:致命错误:cs
- 奇怪的结构&GCC&clang(void*返回类型)
- GCC本机矩阵运算库
- PowerPC ppc64le上的Gcc Woverloaded虚拟错误
- gcc和c++17的过载解析失败
- 终端不会为C++文件创建.exe文件吗
- 数据成员SFINAE的C++17测试:gcc vs clang
- GCC对可能有效的代码抛出init list生存期警告
- 如何解决gcc编译器优化导致的centos双编译器设置中的分段错误
- 使用 GCC 卸载的 OpenMP 卸载失败,并出现"Ptx assembly aborted due to errors"
- 为什么与常规GCC不同,即使有"学究性错误",MinGW-GCC也能容忍丢失的返回类型
- 使用gcc从静态链接的文件中查找可选符号
- gcc 找不到 -lgcc, g++.exe: 错误: 创建进程: 没有这样的文件或目录
- 是否有 gcc 命令可以链接同一目录中的所有 .o 文件并生成.exe文件
- 无法在 Windows 7、32 位上使用 tdm-gcc 构建 cpp 文件(表示 exe 不兼容)
- 我在哪里可以获得 gcc.exe(编译)版本 4.7.0
- MinGW .exe 需要一些 gcc dll 的,不管代码是什么?
- 这段代码有什么问题,gcc不会将其转换为.exe
- MinGW GCC.exe正在从路径中删除所有