0

我从main切换到WinMain并且 Code::Blocks 正在搜索main。我该如何解决?这可能是一个愚蠢的问题,但我在网上找不到。

更新@JBL

#include <iostream>
#include "def.h" //This defines a few things
#include <windows.h>
#include <gl/gl.h>
#include "glcontext.h" //This defines some OpenGL/Win32 functions

using namespace std;

BOOL WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
int nCmdShow)
{

 }
4

1 回答 1

1

如果您将以下内容添加到 Microsoft 链接器选项:

/subsystem:windows /ENTRY:WinMainCRTStartup注意,这对于 GNU 工具链不是必需的。

对于 Microsoft 工具,您也可以将其添加到主文件中:

.#ifdef _MSC_VER .# pragma comment(linker, "/subsystem:windows /ENTRY:WinMainCRTStartup") .#endif

于 2013-05-15T08:18:08.223 回答