Thread: Unresolved external

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    57

    Unresolved external

    Im using msvc++ 6.0 maybe somthing wrong with my library directories or somthing i Guess if anyone can help at all appreciate
    thankx


    Code:
    ///////////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////////
    //////////////////
    //
    //
    // Title: Brads first window from scratch
    // Author: Brad Hoffer
    // Notes: Good luck to myself!
    //
    //
    //////////////////
    ///////////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////////////////
    
    
    #define WIN32_LEAN_AND_MEAN
    
    #include <windows.h>
    
    
    long CALLBACK WndProc( HWND hWnd, UINT uMessage, WPARAM wParam, LPARAM lParam )
    
    {
    	PAINTSTRUCT PaintStruct;
    	
    	HDC hDC;
    	
    	switch (uMessage)
    	{
    		case WM_CREATE:
    			{
    				return 0;
    			}
    
    		case WM_PAINT:
    			{
    				hDC = BeginPaint(hWnd, &PaintStruct);
    
    				EndPaint (hWnd, &PaintStruct);
    
    				return 0;
    			}
    
    		case WM_DESTROY:
    			{
    				PostQuitMessage(0);
    				
    				return 0;
    			}
    
    		default:
    			{
    				return DefWindowProc(hWnd, uMessage, wParam, lParam);
    			}
    	}
    }
    
    
    
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pstrCmdLine, int iCmdShow)
    
    	{
    		HWND hWnd;
    		MSG msg;
    		WNDCLASSEX wc;
    
    		static char strAppName[] = "Brads first win app";
    
    		wc.cbSize = sizeof(WNDCLASSEX);
    		wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
    		wc.cbClsExtra = 0;
    		wc.cbWndExtra = 0;
    		wc.lpfnWndProc = WndProc;
    		wc.hInstance = hInstance;
    		wc.hbrBackground = (HBRUSH)GetStockObject(DKGRAY_BRUSH);
    		wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    		wc.hIconSm = LoadIcon(NULL, IDI_HAND);
    		wc.hCursor = LoadCursor(NULL, IDC_CROSS);
    		wc.lpszMenuName = NULL;
    		wc.lpszClassName = strAppName;
    
    		RegisterClassEx(&wc);
    
    		hWnd = CreateWindowEx( NULL,
    								strAppName,
    								strAppName,
    								WS_OVERLAPPEDWINDOW,
    								CW_USEDEFAULT,
    								CW_USEDEFAULT,
    								512,512,
    								NULL,
    								NULL,
    								hInstance,
    								NULL);
    
    		ShowWindow(hWnd, iCmdShow);
    
    		UpdateWindow(hWnd);
    
    
    		while(GetMessage(&msg, NULL, 0, 0))
    		{
    			TranslateMessage(&msg);
    
    			DispatchMessage(&msg);
    		}
    
    		return msg.wParam;
    }
    here are my errors:

    LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
    Debug/winwo.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.
    =@-OmegatronO-@=

  2. #2
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753
    this usually means you tried to compile it as a "win32 console application" instead of "win32 application"

  3. #3
    Registered User
    Join Date
    Aug 2001
    Posts
    57
    Doh!!
    Thanks that works fine
    =@-OmegatronO-@=

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 02:28 PM
  4. debug to release modes
    By DavidP in forum Game Programming
    Replies: 5
    Last Post: 03-20-2003, 03:01 PM
  5. Unresolved external symbols in OGL
    By Shadow12345 in forum Game Programming
    Replies: 4
    Last Post: 08-04-2002, 09:46 PM