gpt4 book ai didi

c++ - directxtutorial.com 教程不会在 g++ 中编译

转载 作者:太空宇宙 更新时间:2023-11-04 12:02:33 24 4
gpt4 key购买 nike

我希望我可以在某个地方调整编译器设置。我尝试在这里编译源代码: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 错误,其余的不会通过

最佳答案

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

关于c++ - directxtutorial.com 教程不会在 g++ 中编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13544678/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com