Jump to content
  • Advertisement
Sign in to follow this  
DarkCybo1

Problem compiling Win32 under VS2005 Express

This topic is 3914 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The code:
#include <windows.h>

LRESULT CALLBACK WindowProc( HWND hWnd, unsigned int message, WPARAM wP, LPARAM lP )
{

	return ::DefWindowProc( hWnd, message, wP, lP );

}

int WINAPI WinMain( HINSTANCE hInst, HINSTANCE hPrev, LPSTR cmdline, int cmdnum )
{

	HWND wnd;
	WNDCLASSEX wc;

	ZeroMemory( &wc, sizeof( WNDCLASSEX ) );

	wc.cbSize = sizeof( WNDCLASSEX );
	wc.style = CS_VREDRAW | CS_HREDRAW;
	wc.hInstance = hInst;
	wc.lpfnWndProc = (WNDPROC) WindowProc;
	wc.hbrBackground = (HBRUSH) COLOR_WINDOW;
	wc.hCursor = LoadCursor( NULL, IDC_ARROW );
	wc.lpszClassName = L"BasicWin32App";

	::RegisterClassEx( &wc );

}

The build errors: BasicWin32.obj : error LNK2019: unresolved external symbol __imp__DefWindowProcW@16 referenced in function "long __stdcall WindowProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WindowProc@@YGJPAUHWND__@@IIJ@Z) BasicWin32.obj : error LNK2019: unresolved external symbol __imp__RegisterClassExW@4 referenced in function _WinMain@16 BasicWin32.obj : error LNK2019: unresolved external symbol __imp__LoadCursorW@8 referenced in function _WinMain@16 I've already downloaded and installed the Windows Platform SDK, and I've added the lib/include directories for the Platform SDK to my project. What's the problem here?

Share this post


Link to post
Share on other sites
Advertisement
You've told it where to find the .lib files, but have you told it what .lib files it should be linking with?

There's an XML file you can edit (corewin_express.vsprops) to add the .lib files to the list of additional dependencies that are specified for the Win32 project type (so that whenever you create a Win32 project, it'll have the right libraries linked in).
It's explained in this forum post.

Alternatively, you could just switch to VC++ 2008 Express, which comes with the Platform SDK already packaged up to work with it.

John B

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!