MinGW不会编译,错误1 [英] MinGW won't compile, Error 1

查看:170
本文介绍了MinGW不会编译,错误1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在c ++中创建一个简单的hello world应用程序,但它不会编译。我有文件 C:\WiiGames\e3\ 的文件 main.cpp Makefile 。我的makefile是:

Making a simple hello world app in c++, but it won't compile. I have the folder C:\WiiGames\e3\ with the files main.cpp and Makefile. My makefile is:

build: main.cpp
    C:/MinGW/bin/g++.exe main.cpp -o e3.exe

我的错误是:

C:\WiiGames\e3>make build
C:/MinGW/bin/g++.exe main.cpp -o e3.exe
make: *** [build] Error 1

C:\WiiGames\e3>

任何帮助将非常感激。

我的代码:

#include <iostream>
#include <stdio.h>
#include <string>
#include <cmath>
#include <cstdlib>
#include <time.h>

int main() {
    printf("Hello World!");
}

g ++ -v:

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.6.2/configure --enable-languages=c,c++,ada,fortran,objc,obj-c++ --disable-sjlj-exceptions --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-registry --enable-libstdcxx-debug --enable-version-specific-runtime-libs --build=mingw32 --prefix=/mingw
Thread model: win32
gcc version 4.6.2 (GCC)


推荐答案

当你在命令行上直接运行 g ++。exe main.cpp -o e3.exe 时?如果没有发生,是g ++在你的路径?我将首先确保g ++设置和你的路径。

What happens when you run g++.exe main.cpp -o e3.exe on the command line directly? If nothing happens, is g++ in your path? I'd start by making sure that g++ is setup and in your path.

这篇关于MinGW不会编译,错误1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆