1

我希望我可以在某处调整编译器设置。我尝试在这里编译源代码:http ://www.directxtutorial.com/Lesson.aspx?lessonid=9-4-1

它将在 Visual Studio 2010 中编译,但是当我尝试通过 netbeans 在 g++ 中编译时,它给了我这些错误

"/usr/bin/make" -f nbproject/Makefile-Release.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/cygdrive/c/Users/Stephen/Documents/Projects/C++/test'
"/usr/bin/make"  -f nbproject/Makefile-Release.mk dist/Release/Cygwin-Windows/test.exe
make[2]: Entering directory `/cygdrive/c/Users/Stephen/Documents/Projects/C++/test'
mkdir -p build/Release/Cygwin-Windows
rm -f build/Release/Cygwin-Windows/main.o.d
g++.exe    -c -g -MMD -MP -MF build/Release/Cygwin-Windows/main.o.d -o build/Release/Cygwin-Windows/main.o main.cpp
main.cpp: In function `int WinMain(HINSTANCE__*, HINSTANCE__*, CHAR*, int)':
main.cpp:39: error: cannot convert `const wchar_t[12]' to `const CHAR*' in assignment
main.cpp:52: warning: converting to non-pointer type `DWORD' from NULL
main.cpp:52: error: cannot convert `const wchar_t*' to `const CHAR*' for argument `2' to `HWND__* CreateWindowExA(DWORD, const CHAR*, const CHAR*, DWORD, int, int, int, int, HWND__*, HMENU__*, HINSTANCE__*, void*)'
nbproject/Makefile-Release.mk:66: recipe for target `build/Release/Cygwin-Windows/main.o' failed
make[2]: *** [build/Release/Cygwin-Windows/main.o] Error 1
make[2]: Leaving directory `/cygdrive/c/Users/Stephen/Documents/Projects/C++/test'
make[1]: *** [.build-conf] Error 2
nbproject/Makefile-Release.mk:59: recipe for target `.build-conf' failed
make: *** [.build-impl] Error 2
make[1]: Leaving directory `/cygdrive/c/Users/Stephen/Documents/Projects/C++/test'
nbproject/Makefile-impl.mk:39: recipe for target `.build-impl' failed

BUILD FAILED (exit value 2, total time: 1s)

我可以轻松摆脱 main.cpp: 39 和 52 错误,其余的不会通过

4

1 回答 1

1

将 MinGW 用于 WIN32 源,而不是 Cygwin。

于 2012-11-24T19:23:16.343 回答