Skip to main content
gamedev.net
🔒 Locked

compiler error

Started by tototam 0 replies 500+ views
Original Post
tototam
tototam
compiler errors: ************************************************************* LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main Debug/GAME.exe : fatal error LNK1120: 1 unresolved externals ************************************************************* the program is : *************************************************************** #include <windows.h> int WINAPI WinMain(HINSTANCE hinst,HINSTANCE hprevinst,LPSTR lpcmdline,int ncmdshow); LRESULT CALLBACK Windowproc(HWND hwnd,UINT msg,WPARAM wparam ,LPARAM lparam); int WINAPI WinMain(HINSTANCE hinst,HINSTANCE hprevinst,LPSTR lpcmdline,int ncmdshow) { HWND hwnd; MSG msg; WNDCLASSEX wc={sizeof(WNDCLASSEX),CS_CLASSDC,Windowproc,0L,0L,hinst,NULL,NULL,NULL,NULL,"GAMECLASS",NULL}; RegisterClassEx(&wc); hwnd=CreateWindow("GAMECLASS","GAME",WS_MAXIMIZE|WS_OVERLAPPED,0,0,400,400,NULL,NULL,hinst,NULL); ShowWindow(hwnd,SW_SHOWNORMAL); UpdateWindow(hwnd); ZeroMemory(&msg,sizeof(MSG)); while(msg.message!=WM_QUIT){ if(PeekMessage(&msg,NULL,0,0,PM_REMOVE)){ TranslateMessage(&msg); DispatchMessage(&msg); }else{ } } UnregisterClass("GAMECLASS",hinst); return 0; } LRESULT CALLBACK Windowproc(HWND hwnd,UINT msg ,WPARAM wparam , LPARAM lparam) { switch (msg){ case WM_DESTROY: PostQuitMessage(0); break; } return 0; } ************************************************************ How can i solve it? and then , can you suggestion some option to compiler setting(project option)? tototam
tototam
Eriond
Eriond
Dont use a conole application. Use win32

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.