link error 2019

need help with direct x 9

Page 1 of 1

2 Replies - 2006 Views - Last Post: 17 January 2010 - 08:29 PM Rate Topic: -----

#1 tdubs   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 28-January 09

link error 2019

Posted 16 January 2010 - 11:29 AM

Hi all i'm having a little issue with direct x 9 i'm just starting the chapter in the book called beginning direct x 9.
the code in the book in chapter 2 compiles fine but dose not build because of link errors

the two that i get are

error LNK2019: unresolved external symbol "bool __cdecl initWindow(struct HINSTANCE__ *)" ([email protected]@[email protected]@@Z) referenced in function [email protected]

and

fatal error LNK1120: 1 unresolved externals

now i have included the proper libs, excutables, via sdk files

i see where the problem lies but unsure how to fix it

in this function with two peramiters


bool initWindow(HINSTANCE hInstance);

for refferance this is a windows application. The book ask to create one
Invorment is vs 2008

ty tom

Is This A Good Question/Topic? 0
  • +

Replies To: link error 2019

#2 KYA   User is offline

  • Wubba lubba dub dub!
  • member icon

Reputation: 3207
  • View blog
  • Posts: 19,239
  • Joined: 14-September 07

Re: link error 2019

Posted 16 January 2010 - 12:16 PM

Why don't you provide the code? Shouldn't be too long.

Quote

now i have included the proper libs, excutables, via sdk files


We have no way to verify that without anything to look at.

Looks like that function takes two parameters [or more depending on the reference from MSDN] and you're only passing one?
Was This Post Helpful? 0
  • +
  • -

#3 tdubs   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 28-January 09

Re: link error 2019

Posted 17 January 2010 - 08:29 PM

here is the code it's just a basic window application

// incluce the wondows header file that's needed for all windows application
#include <windows.h>

HINSTANCE hInst; // global handle to hold the application instance
HWND wndHandle; // global variable to hold the window handle

// forward declarations
bool initWindow(HINSTANCE hInstance);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);

// This is winmain, the main entry point for the Windows application
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdshow)
{
// intializ the window
if ( !initWindow (hInstance))
return false;

// main message loop:
MSG msg;
ZeroMemory ( &msg, sizeof (msg));
while (msg.message!=WM_QUIT)
{
// check the message queue
while(GetMessage (&msg, wndHandle, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}


i'm familiar with adding links but not sure what to link i thought i attached it guess not
thanks for your supprot. i did some research on msdn and i'm not understanding what it offers.
i can grasp a variable not taking an argument
but with this i'm clueless i set the porgam to unicode still no dice.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1