【发布时间】:2012-04-01 00:58:52
【问题描述】:
用 c++ 制作一个简单的 hello world 应用程序,但它不会编译。我有文件夹C:\WiiGames\e3\ 和文件main.cpp 和Makefile。我的makefile是:
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)
【问题讨论】:
-
如果你提供你的代码会更容易回答。