unexpected end of file -_-

Started by
12 comments, last by jflanglois 16 years, 11 months ago
Sorry if this is a dumb question, but im rather new to Win32 programming. The error im getting is this:
Quote:Error 1 fatal error RC1004: unexpected end of file found c:\Documents and Settings\mads\Dokumenter\Visual Studio 2005\Projects\SexyEngine1\SexyEngine1\Resource.h 4
and has to do with this file .h file: (Resource.h)
//iconer		Range: 1000-1999

#define IDI_BLIZZARD		1000
#define IDI_BLIZZARD_SM		1001
however i cant realy see how i can mess 2 lines up.. So here goes the rest of the code: (SexyEngine1.h)

//SexyEngine class

class SexyEngine
{
 protected:
  //medlems variabler
  static SexyEngine*	m_pSexyEngine;
  HINSTANCE				m_hInstance;
  HWND					m_hWindow;
  TCHAR					m_szWindowClass[32];
  TCHAR					m_szTitle[32];
  WORD					m_wIcon, m_wSmallIcon;
  int					m_iWidth, m_iHeight;
  int					m_iFrameDelay;
  BOOL					m_bSleep;
  
 public:
  //constructor/destructor
  SexyEngine(HINSTANCE hInstance, LPTSTR szWindoClass, LPTSTR szTitle, WORD wIcon, WORD wSmallIcon, int iWidth = 640, int iHeight = 480);
  virtual ~SexyEngine();
  
  //generale metoder
  static SexyEngine* GetEngine() {return m_pSexyEngine;};
  BOOL Initialize(int iCmdShow);
  LRESULT HandleEvent(HWND hWindow, UINT msg, WPARAM wParam, LPARAM lParam);
  
  //adgangs metoder
  HINSTANCE GetInstance() {return m_hInstance;};
  HWND GetWindow() {return m_hWindow;};
  void SetWindow(HWND hWindow) { m_hWindow = hWindow;};
  LPTSTR GetTitle() {return m_szTitle;};
  WORD GetIcon() {return m_wIcon;};
  WORD GetSmallIcon() {return m_wSmallIcon;};
  int GetWidth() {return m_iWidth;};
  int GetHeight() {return m_iHeight;};
  int GetFrameDelay() {return m_iFrameDelay;};
  void SetFrameRate (int iFrameRate) { m_iFrameDelay = 1000 / iFrameRate;};
  BOOL GetSleep() {return m_bSleep;};
  void SetSleep(BOOL bSleep) {m_bSleep = bSleep;};
};//end of SexyEngine class

(Storm.h)
#pragma once


//include filer

#include <windows.h>
#include "Resource.h"
#include "SexyEngine1.h"

//globale variabler
SexyEngine* g_pGame;

(Storm.rc)
#include "Resource.h"

//iconer

IDI_BLIZZARD         ICON       "C:\Documents and Settings\mads\Dokumenter\roflfjering.ico"
IDI_BLIZZARD         ICON       "C:\Documents and Settings\mads\Dokumenter\roflfjering.ico"

(SexyEngine.cpp)
[source lang ="cpp"]
#include "SexyEngine1.h"

//static variabel initialisation
SexyEngine* SexyEngine::m_pSexyEngine = NULL;

//windows funktioner

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLine, int iCmdShow)
{
 MSG		msg;
 static int	iTickTrigger = 0;
 int		iTickCount;
 
 if (GameInitialize(hInstance))
 {
  //initialiser(not to self: er begyndt at hade det ord..) SexyEngine
  if (!SexyEngine::GetEngine()->Initialize(iCmdShow))
   return FALSE;
  
  while (TRUE)
  {
   if( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
   {
    //proces beskeden
    if (msg.message == WM_QUIT)
     break;
    TranslateMessage(&msg);
    DispatchMessage(&msg);
   }
   else
   {
    //vær sikker på at engien ikke sover
    if (!SexyEngine::GetEngine()->GetSleep())
    {
     iTickCount = GetTickCount();
     if (iTickCount > iTickTrigger)
     {
      iTickTrigger = iTickCount + SexyEngine::GetEngine()->GetFrameDelay();
      GameCycle();
	 }
	}
   }
  }
 return (int)msg.wParam;
 }
 GameEnd();
 
return TRUE;
}

LRESULT CALLBACK WndProc(HWND hWindow, UINT msg, WPARAM wParam, LPARAM lParam)
{
 return SexyEngine::GetEngine()->HandleEvent(hWindow, msg, wParam, lParam);
}

//game engine constructor(s) + destructor definationer

SexyEngine::SexyEngine(HINSTANCE hInstance, LPTSTR szWindowClass, LPTSTR szTitle, WORD wIcon, WORD wSmallIcon, int iWidth, int iHeight)
{
 //sætter member variablerne for SexyEngine
 m_pSexyEngine = this;
 m_hInstance = hInstance;
 m_hWindow = NULL;
 if (lstrlen(szWindowClass) > 0)
  lstrcpy(m_szWindowClass, szWindowClass);
 if (lstrlen(szTitle) > 0)
  lstrcpy(m_szTitle, szTitle);
 m_wIcon = wIcon;
 m_wSmallIcon = wSmallIcon;
 m_iWidth = iWidth;
 m_iHeight = iHeight;
 m_iFrameDelay = 50; //20 fps default
 m_bSleep = TRUE;
}

SexyEngine::~SexyEngine()
{
}

//SexyEngine generale Metoder

BOOL SexyEngine::Initialize(int iCmdShow)
{
 WNDCLASSEX wndclass;
 
 wndclass.cbSize		=sizeof(wndclass);
 wndclass.style			=CS_HREDRAW | CS_VREDRAW;
 wndclass.lpfnWndProc	= WndProc;
 wndclass.cbClsExtra	= 0;
 wndclass.cbWndExtra	= 0;
 wndclass.hInstance		= m_hInstance;
 wndclass.hIcon			= LoadIcon(m_hInstance, MAKEINTRESOURCE(GetIcon()));
 wndclass.hIconSm		= LoadIcon(m_hInstance, MAKEINTRESOURCE(GetSmallIcon()));
 wndclass.hbrBackground	= (HBRUSH)(COLOR_WINDOW + 1);
 wndclass.lpszMenuName	= NULL;
 wndclass.lpszClassName	= m_szWindowClass;
 
 //registrer window classen
 if (!RegisterClassEx(&wndclass))
  return FALSE;
 
 //vidnuet bliver lavet i midten
 int iWindowWidth = m_iWidth + GetSystemMetrics(SM_CXFIXEDFRAME) * 2, iWindowHeight = m_iHeight + GetSystemMetrics(SM_CYFIXEDFRAME) * 2 + GetSystemMetrics(SM_CYCAPTION);
 if (wndclass.lpszMenuName != NULL)
  iWindowHeight += GetSystemMetrics(SM_CYMENU);
 int iXWindowPos = (GetSystemMetrics(SM_CXSCREEN) - iWindowWidth) / 2, iYWindowPos = (GetSystemMetrics(SM_CYSCREEN) - iWindowHeight) / 2;
 
 //Laver vinduet
 m_hWindow = CreateWindow(m_szWindowClass, m_szTitle, WS_POPUPWINDOW | WS_CAPTION | WS_MINIMIZE, iXWindowPos, iYWindowPos, iWindowWidth, iWindowHeight, NULL, NULL, m_hInstance, NULL);
 if (!m_hWindow)
  return FALSE;
  
 //vis og updater vinduet
 ShowWindow(m_hWindow, iCmdShow);
 UpdateWindow(m_hWindow);

return TRUE;
}


LRESULT SexyEngine::HandleEvent(HWND hWindow, UINT msg, WPARAM wParam, LPARAM lParam)
{
 //efter at have sendt alle 'beskeder' til SexyEngines HandleEvent()
 switch (msg)
 {
  case WM_CREATE:
   //sætter spille vinduet og starter spillet
   SetWindow(hWindow);
   GameStart(hWindow);
   return 0;
  
  case WM_SETFOCUS:
   //activer spillevinduet og opdater sleep statusen
   GameActivate(hWindow);
   SetSleep(FALSE);
   return 0;
  
  case WM_PAINT:
   HDC hDC;
   PAINTSTRUCT ps;
   hDC = BeginPaint(hWindow, &ps);
   //tegn spillet
   GamePaint(hDC);
   
   EndPaint(hWindow, &ps);
   return 0;
  
  case WM_DESTROY:
   //slut spillet og skrid fra applicationen
   GameEnd();
   PostQuitMessage(0);
   return 0;
 }
return DefWindowProc(hWindow, msg, wParam, lParam);
}
// mads ztyrer!

(Storm.cpp)

#include "Storm.h"

//game engine funktioner
BOOL GameInitialize(HINSTANCE hInstance)
{
 g_pGame = new SexyEngine(hInstance, TEXT("Fjering"), TEXT("FJERING"), IDI_BLIZZARD, IDI_BLIZZARD_SM);
 if (g_pGame == NULL)
  return FALSE;
 
 //sætter frame raten
 g_pGame->SetFrameRate(15);
 
return TRUE;
}

void GameStart(HWND hWindow)
{
 //Seeder RANDom nummer generatoren
 srand(GetTickCount());
}

void GameEnd()
{
 //rydder op i game engine
 delete g_pGame;
}

void GameActivate(HWND hWindow)
{
 HDC hDC;
 RECT rect;
 //tegn hvad der sker på skærmen
 GetClientRect(hWindow,&rect);
 hDC = GetDC(hWindow);
 DrawText(hDC,TEXT("Her kommer der en storm!"), -1, &rect, DT_SINGLELINE| DT_CENTER | DT_VCENTER);
ReleaseDC(hWindow,hDC);
}

void GameDeactivate(HWND hWindow)
{
 HDC hDC;
 RECT rect;
 //tegn deaktiverings tekst op skærmen
 GetClientRect(hWindow, &rect);
 hDC = GetDC(hWindow);
 DrawText(hDC,TEXT("Stormen er ovre."), -1, &rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
ReleaseDC(hWindow, hDC);
}

void GamePaint(HDC hDC)
{
}

void GameCycle()
{
 HDC hDC;
 HWND hWindow = g_pGame->GetWindow();
  
 //tegn storm partiklerne på skærmen
 hDC = GetDC(hWindow);
  
 DrawIcon(hDC, rand() % g_pGame->GetWidth(), g_pGame->GetHeight(), (HICON)(WORD)GetClassLong(hWindow, GCL_HICON));
ReleaseDC(hWindow, hDC);
} 
  

.. and thats it. Hopefully this isnt such a stupid question that i have to change my nick [embarrass] thanks!, Mads
•°*”˜˜”*°•.˜”*°•..•°*”˜.•°*”˜˜”*°•..•°*”˜˜”*°•.˜”*°•.˜”*°•. Mads .•°*”˜.•°*”˜.•°*”˜˜”*°•.˜”*°•..•°*”˜.•°*”˜.•°*”˜ ˜”*°•.˜”*°•.˜”*°•..•°*”˜I am going to live forever... or die trying!
Advertisement
RC1004: add a blank line at the end of Resource.h. In fact, do this with all your headers (I don't remember the exact technical reason for this, something about the preprocessor being so stupid that it will not insert blank lines between two included files, someone else will know more). It's not that obvious, though. You also have IDI_BLIZZARD defined twice in Storm.rc.



jfl.
^Thanks! your post made me smile :) sorry for hijacking my own thread, but i still have a little problem. Now the computer complains about my images not being the right format.. or somewhat:
Error 1 error RC2175 : resource file roflfjering.ico is not in 3.00 format c:\Documents and Settings\mads\Dokumenter\Storm.rc 5
[/copy]
When i made the two pictures i did it in paint->used jpg, but enden my file with .icon.
i gues i should had done it another way.. but how do i make it a 3.00 format?

MSDN isnt helping me out very well..
•°*”˜˜”*°•.˜”*°•..•°*”˜.•°*”˜˜”*°•..•°*”˜˜”*°•.˜”*°•.˜”*°•. Mads .•°*”˜.•°*”˜.•°*”˜˜”*°•.˜”*°•..•°*”˜.•°*”˜.•°*”˜ ˜”*°•.˜”*°•.˜”*°•..•°*”˜I am going to live forever... or die trying!
You can't rename JPEG image to ICO image. The best would be to use some special tool that can handle ICO file directly (GIMP comes to my mind). On the other hand, you CAN rename BMP file to ICO file - it usually works.

I would recommend you to get GIMP and use that for all of your icons. You can get it here - it's FREE!!! :)
thanks for your link. Seems to have solved my problem, however it opens up for quite a few nasty errors. please tell me what i did wrong, im one error from getting a nervous breakdown.
Quote:Error 1 error LNK2028: unresolved token (0A00001A) "extern "C" int __stdcall EndPaint(struct HWND__ *,struct tagPAINTSTRUCT const *)" (?EndPaint@@$$J18YGHPAUHWND__@@PBUtagPAINTSTRUCT@@@Z) referenced in function "public: long __thiscall SexyEngine::HandleEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?HandleEvent@SexyEngine@@$$FQAEJPAUHWND__@@IIJ@Z) SexyEngine1.obj
Error 2 error LNK2028: unresolved token (0A000023) "extern "C" void __stdcall PostQuitMessage(int)" (?PostQuitMessage@@$$J14YGXH@Z) referenced in function "public: long __thiscall SexyEngine::HandleEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?HandleEvent@SexyEngine@@$$FQAEJPAUHWND__@@IIJ@Z) SexyEngine1.obj
Error 3 error LNK2028: unresolved token (0A00002D) "extern "C" struct HDC__ * __stdcall BeginPaint(struct HWND__ *,struct tagPAINTSTRUCT *)" (?BeginPaint@@$$J18YGPAUHDC__@@PAUHWND__@@PAUtagPAINTSTRUCT@@@Z) referenced in function "public: long __thiscall SexyEngine::HandleEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?HandleEvent@SexyEngine@@$$FQAEJPAUHWND__@@IIJ@Z) SexyEngine1.obj
Error 4 error LNK2028: unresolved token (0A000030) "extern "C" int __stdcall TranslateMessage(struct tagMSG const *)" (?TranslateMessage@@$$J14YGHPBUtagMSG@@@Z) referenced in function "extern "C" int __stdcall WinMain(struct HINSTANCE__ *,struct HINSTANCE__ *,char *,int)" (?WinMain@@$$J216YGHPAUHINSTANCE__@@0PADH@Z) SexyEngine1.obj
Error 5 error LNK2028: unresolved token (0A000033) "extern "C" unsigned short __stdcall RegisterClassExW(struct tagWNDCLASSEXW const *)" (?RegisterClassExW@@$$J14YGGPBUtagWNDCLASSEXW@@@Z) referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@$$FQAEHH@Z) SexyEngine1.obj
Error 6 error LNK2028: unresolved token (0A000034) "extern "C" struct HICON__ * __stdcall LoadIconW(struct HINSTANCE__ *,wchar_t const *)" (?LoadIconW@@$$J18YGPAUHICON__@@PAUHINSTANCE__@@PB_W@Z) referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@$$FQAEHH@Z) SexyEngine1.obj
Error 7 error LNK2028: unresolved token (0A00003B) "extern "C" int __stdcall PeekMessageW(struct tagMSG *,struct HWND__ *,unsigned int,unsigned int,unsigned int)" (?PeekMessageW@@$$J220YGHPAUtagMSG@@PAUHWND__@@III@Z) referenced in function "extern "C" int __stdcall WinMain(struct HINSTANCE__ *,struct HINSTANCE__ *,char *,int)" (?WinMain@@$$J216YGHPAUHINSTANCE__@@0PADH@Z) SexyEngine1.obj
Error 8 error LNK2028: unresolved token (0A000042) "extern "C" int __stdcall ShowWindow(struct HWND__ *,int)" (?ShowWindow@@$$J18YGHPAUHWND__@@H@Z) referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@$$FQAEHH@Z) SexyEngine1.obj
Error 9 error LNK2028: unresolved token (0A000047) "extern "C" struct HWND__ * __stdcall CreateWindowExW(unsigned long,wchar_t const *,wchar_t const *,unsigned long,int,int,int,int,struct HWND__ *,struct HMENU__ *,struct HINSTANCE__ *,void *)" (?CreateWindowExW@@$$J248YGPAUHWND__@@KPB_W0KHHHHPAU1@PAUHMENU__@@PAUHINSTANCE__@@PAX@Z) referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@$$FQAEHH@Z) SexyEngine1.obj
Error 10 error LNK2028: unresolved token (0A00004B) "extern "C" int __stdcall GetSystemMetrics(int)" (?GetSystemMetrics@@$$J14YGHH@Z) referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@$$FQAEHH@Z) SexyEngine1.obj
Error 11 error LNK2028: unresolved token (0A00004E) "extern "C" int __stdcall UpdateWindow(struct HWND__ *)" (?UpdateWindow@@$$J14YGHPAUHWND__@@@Z) referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@$$FQAEHH@Z) SexyEngine1.obj
Error 12 error LNK2028: unresolved token (0A000050) "extern "C" long __stdcall DefWindowProcW(struct HWND__ *,unsigned int,unsigned int,long)" (?DefWindowProcW@@$$J216YGJPAUHWND__@@IIJ@Z) referenced in function "public: long __thiscall SexyEngine::HandleEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?HandleEvent@SexyEngine@@$$FQAEJPAUHWND__@@IIJ@Z) SexyEngine1.obj
Error 13 error LNK2028: unresolved token (0A000053) "extern "C" long __stdcall DispatchMessageW(struct tagMSG const *)" (?DispatchMessageW@@$$J14YGJPBUtagMSG@@@Z) referenced in function "extern "C" long __cdecl DispatchMessage(struct tagMSG const *)" (?DispatchMessage@@$$J0YAJPBUtagMSG@@@Z) SexyEngine1.obj
Error 14 error LNK2028: unresolved token (0A00001E) "extern "C" int __stdcall DrawTextW(struct HDC__ *,wchar_t const *,int,struct tagRECT *,unsigned int)" (?DrawTextW@@$$J220YGHPAUHDC__@@PB_WHPAUtagRECT@@I@Z) referenced in function "extern "C" int __cdecl DrawText(struct HDC__ *,wchar_t const *,int,struct tagRECT *,unsigned int)" (?DrawText@@$$J0YAHPAUHDC__@@PB_WHPAUtagRECT@@I@Z) Storm.obj
Error 15 error LNK2028: unresolved token (0A000022) "extern "C" int __stdcall DrawIcon(struct HDC__ *,int,int,struct HICON__ *)" (?DrawIcon@@$$J216YGHPAUHDC__@@HHPAUHICON__@@@Z) referenced in function "void __cdecl GameCycle(void)" (?GameCycle@@$$FYAXXZ) Storm.obj
Error 16 error LNK2028: unresolved token (0A000024) "extern "C" int __stdcall GetClientRect(struct HWND__ *,struct tagRECT *)" (?GetClientRect@@$$J18YGHPAUHWND__@@PAUtagRECT@@@Z) referenced in function "void __cdecl GameActivate(struct HWND__ *)" (?GameActivate@@$$FYAXPAUHWND__@@@Z) Storm.obj
Error 17 error LNK2028: unresolved token (0A000027) "extern "C" unsigned long __stdcall GetClassLongW(struct HWND__ *,int)" (?GetClassLongW@@$$J18YGKPAUHWND__@@H@Z) referenced in function "void __cdecl GameCycle(void)" (?GameCycle@@$$FYAXXZ) Storm.obj
Error 18 error LNK2028: unresolved token (0A000029) "extern "C" struct HDC__ * __stdcall GetDC(struct HWND__ *)" (?GetDC@@$$J14YGPAUHDC__@@PAUHWND__@@@Z) referenced in function "void __cdecl GameActivate(struct HWND__ *)" (?GameActivate@@$$FYAXPAUHWND__@@@Z) Storm.obj
Error 19 error LNK2028: unresolved token (0A000034) "extern "C" int __stdcall ReleaseDC(struct HWND__ *,struct HDC__ *)" (?ReleaseDC@@$$J18YGHPAUHWND__@@PAUHDC__@@@Z) referenced in function "void __cdecl GameActivate(struct HWND__ *)" (?GameActivate@@$$FYAXPAUHWND__@@@Z) Storm.obj
Error 20 error LNK2019: unresolved external symbol "extern "C" long __stdcall DispatchMessageW(struct tagMSG const *)" (?DispatchMessageW@@$$J14YGJPBUtagMSG@@@Z) referenced in function "extern "C" long __cdecl DispatchMessage(struct tagMSG const *)" (?DispatchMessage@@$$J0YAJPBUtagMSG@@@Z) SexyEngine1.obj
Error 21 error LNK2019: unresolved external symbol "extern "C" long __stdcall DefWindowProcW(struct HWND__ *,unsigned int,unsigned int,long)" (?DefWindowProcW@@$$J216YGJPAUHWND__@@IIJ@Z) referenced in function "public: long __thiscall SexyEngine::HandleEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?HandleEvent@SexyEngine@@$$FQAEJPAUHWND__@@IIJ@Z) SexyEngine1.obj
Error 22 error LNK2019: unresolved external symbol "extern "C" void __stdcall PostQuitMessage(int)" (?PostQuitMessage@@$$J14YGXH@Z) referenced in function "public: long __thiscall SexyEngine::HandleEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?HandleEvent@SexyEngine@@$$FQAEJPAUHWND__@@IIJ@Z) SexyEngine1.obj
Error 23 error LNK2019: unresolved external symbol "extern "C" int __stdcall EndPaint(struct HWND__ *,struct tagPAINTSTRUCT const *)" (?EndPaint@@$$J18YGHPAUHWND__@@PBUtagPAINTSTRUCT@@@Z) referenced in function "public: long __thiscall SexyEngine::HandleEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?HandleEvent@SexyEngine@@$$FQAEJPAUHWND__@@IIJ@Z) SexyEngine1.obj
Error 24 error LNK2019: unresolved external symbol "extern "C" struct HDC__ * __stdcall BeginPaint(struct HWND__ *,struct tagPAINTSTRUCT *)" (?BeginPaint@@$$J18YGPAUHDC__@@PAUHWND__@@PAUtagPAINTSTRUCT@@@Z) referenced in function "public: long __thiscall SexyEngine::HandleEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?HandleEvent@SexyEngine@@$$FQAEJPAUHWND__@@IIJ@Z) SexyEngine1.obj
Error 25 error LNK2019: unresolved external symbol "extern "C" int __stdcall UpdateWindow(struct HWND__ *)" (?UpdateWindow@@$$J14YGHPAUHWND__@@@Z) referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@$$FQAEHH@Z) SexyEngine1.obj
Error 26 error LNK2019: unresolved external symbol "extern "C" int __stdcall ShowWindow(struct HWND__ *,int)" (?ShowWindow@@$$J18YGHPAUHWND__@@H@Z) referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@$$FQAEHH@Z) SexyEngine1.obj
Error 27 error LNK2019: unresolved external symbol "extern "C" struct HWND__ * __stdcall CreateWindowExW(unsigned long,wchar_t const *,wchar_t const *,unsigned long,int,int,int,int,struct HWND__ *,struct HMENU__ *,struct HINSTANCE__ *,void *)" (?CreateWindowExW@@$$J248YGPAUHWND__@@KPB_W0KHHHHPAU1@PAUHMENU__@@PAUHINSTANCE__@@PAX@Z) referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@$$FQAEHH@Z) SexyEngine1.obj
Error 28 error LNK2019: unresolved external symbol "extern "C" int __stdcall GetSystemMetrics(int)" (?GetSystemMetrics@@$$J14YGHH@Z) referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@$$FQAEHH@Z) SexyEngine1.obj
Error 29 error LNK2019: unresolved external symbol "extern "C" unsigned short __stdcall RegisterClassExW(struct tagWNDCLASSEXW const *)" (?RegisterClassExW@@$$J14YGGPBUtagWNDCLASSEXW@@@Z) referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@$$FQAEHH@Z) SexyEngine1.obj
Error 30 error LNK2019: unresolved external symbol "extern "C" struct HICON__ * __stdcall LoadIconW(struct HINSTANCE__ *,wchar_t const *)" (?LoadIconW@@$$J18YGPAUHICON__@@PAUHINSTANCE__@@PB_W@Z) referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@$$FQAEHH@Z) SexyEngine1.obj
Error 31 error LNK2019: unresolved external symbol "extern "C" int __stdcall TranslateMessage(struct tagMSG const *)" (?TranslateMessage@@$$J14YGHPBUtagMSG@@@Z) referenced in function "extern "C" int __stdcall WinMain(struct HINSTANCE__ *,struct HINSTANCE__ *,char *,int)" (?WinMain@@$$J216YGHPAUHINSTANCE__@@0PADH@Z) SexyEngine1.obj
Error 32 error LNK2019: unresolved external symbol "extern "C" int __stdcall PeekMessageW(struct tagMSG *,struct HWND__ *,unsigned int,unsigned int,unsigned int)" (?PeekMessageW@@$$J220YGHPAUtagMSG@@PAUHWND__@@III@Z) referenced in function "extern "C" int __stdcall WinMain(struct HINSTANCE__ *,struct HINSTANCE__ *,char *,int)" (?WinMain@@$$J216YGHPAUHINSTANCE__@@0PADH@Z) SexyEngine1.obj
Error 33 error LNK2019: unresolved external symbol "extern "C" int __stdcall DrawTextW(struct HDC__ *,wchar_t const *,int,struct tagRECT *,unsigned int)" (?DrawTextW@@$$J220YGHPAUHDC__@@PB_WHPAUtagRECT@@I@Z) referenced in function "extern "C" int __cdecl DrawText(struct HDC__ *,wchar_t const *,int,struct tagRECT *,unsigned int)" (?DrawText@@$$J0YAHPAUHDC__@@PB_WHPAUtagRECT@@I@Z) Storm.obj
Error 34 error LNK2019: unresolved external symbol "extern "C" int __stdcall ReleaseDC(struct HWND__ *,struct HDC__ *)" (?ReleaseDC@@$$J18YGHPAUHWND__@@PAUHDC__@@@Z) referenced in function "void __cdecl GameActivate(struct HWND__ *)" (?GameActivate@@$$FYAXPAUHWND__@@@Z) Storm.obj
Error 35 error LNK2019: unresolved external symbol "extern "C" struct HDC__ * __stdcall GetDC(struct HWND__ *)" (?GetDC@@$$J14YGPAUHDC__@@PAUHWND__@@@Z) referenced in function "void __cdecl GameActivate(struct HWND__ *)" (?GameActivate@@$$FYAXPAUHWND__@@@Z) Storm.obj
Error 36 error LNK2019: unresolved external symbol "extern "C" int __stdcall GetClientRect(struct HWND__ *,struct tagRECT *)" (?GetClientRect@@$$J18YGHPAUHWND__@@PAUtagRECT@@@Z) referenced in function "void __cdecl GameActivate(struct HWND__ *)" (?GameActivate@@$$FYAXPAUHWND__@@@Z) Storm.obj
Error 37 error LNK2019: unresolved external symbol "extern "C" int __stdcall DrawIcon(struct HDC__ *,int,int,struct HICON__ *)" (?DrawIcon@@$$J216YGHPAUHDC__@@HHPAUHICON__@@@Z) referenced in function "void __cdecl GameCycle(void)" (?GameCycle@@$$FYAXXZ) Storm.obj
Error 38 error LNK2019: unresolved external symbol "extern "C" unsigned long __stdcall GetClassLongW(struct HWND__ *,int)" (?GetClassLongW@@$$J18YGKPAUHWND__@@H@Z) referenced in function "void __cdecl GameCycle(void)" (?GameCycle@@$$FYAXXZ) Storm.obj
Error 39 fatal error LNK1120: 38 unresolved externals C:\Documents and Settings\mads\Dokumenter\Visual Studio 2005\Projects\SexyEngine1\Debug\SexyEngine1.exe


this is my code:
Quote:
#include "Resource.h"

//iconer

IDI_BLIZZARD ICON "C:\Documents and Settings\mads\Dokumenter\fjeringrofl.ico"
IDI_BLIZZARD_SM ICON "C:\Documents and Settings\mads\Dokumenter\fjeringrofl_sm.ico"


when i made my image, i saved it as a .ico file(choosen from the droopdown menu) however it dosent seem to have worked..
•°*”˜˜”*°•.˜”*°•..•°*”˜.•°*”˜˜”*°•..•°*”˜˜”*°•.˜”*°•.˜”*°•. Mads .•°*”˜.•°*”˜.•°*”˜˜”*°•.˜”*°•..•°*”˜.•°*”˜.•°*”˜ ˜”*°•.˜”*°•.˜”*°•..•°*”˜I am going to live forever... or die trying!
OK, so when you get linker errors like that, you usually want to figure out which library you forgot to tell your linker about. EndPaint is a GDI function, so you would look it up on MSDN. Under the "Requirements" section, you want to find "Library". For EndPaint, it is user32.lib, which makes me wonder whether you have followed all the instructions here (particularly step 4). Anyway, let's assume you did it right. You would then take the name "user32.lib" and add it to Project->Properties->Configuration Properties->Linker->Input->Additional Dependencies.


jfl.
Actually, let me add to that. Half the battle in C++ is understanding compiler errors:

Error 1 error LNK2028: unresolved token (0A00001A)                 ^               LNK: this is a linker error."extern "C" int __stdcall EndPaint(struct HWND__ *,struct tagPAINTSTRUCT const *)"                             ^                     ^                             |        The parameters and return type can be useful to know                             |        in certain circumstances (such as when it refers to                             |        one of your functions), but not here.                             |           (1)  This is the name of the function that the linker can't find(?EndPaint@@$$J18YGHPAUHWND__@@PBUtagPAINTSTRUCT@@@Z)                         ^   This is just the mangled name. You can look into "ABI"s if your interested in   that mess.referenced in function "public: long __thiscall SexyEngine::HandleEvent [...] SexyEngine1.obj                                                             ^                    ^                                                             |____________________|                                                             |                                           (2)  This is where you refer to EndPaint


Exhibit (1) is the more important one, as it will usually give you an indication of what went wrong. Nevertheless, exhibit (2) can be useful as well, although usually in the case of redefinition errors.


jfl.
whoa thanks! ++rating!

I have already done those steps + i just double checked.

btw, this is the "files(?)" in corewin_express that i have:

AdditionalDependencies="kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib" />

i realy appriciate your help. Im completely lost in this problem.
•°*”˜˜”*°•.˜”*°•..•°*”˜.•°*”˜˜”*°•..•°*”˜˜”*°•.˜”*°•.˜”*°•. Mads .•°*”˜.•°*”˜.•°*”˜˜”*°•.˜”*°•..•°*”˜.•°*”˜.•°*”˜ ˜”*°•.˜”*°•.˜”*°•..•°*”˜I am going to live forever... or die trying!
Oh, hold on a second. It seems I've made a faux pas. LNK2028 actually refers to importing native functions into CLR projects. Make sure that "Project->Properties->Configuration Properties->General->Common Language Runtime Support" is set to "No Common Language Runtime Support". When you create a new project, make sure you don't select a CLR project to avoid this.

That is, of course, asuming you don't want a CLR project. Looking at your code, though, I'd say it's a safe bet that you don't :)

My previous posts are still generally applicable, though.
i have done that now. I also deleted the text: $(NoInherit) that was written after additional dependencies, and my program now runs! however it, in no way act like it is supposed to, so maybe it wasnt such a good idea..

if i paste it back, i get these errors:

Quote:Error 1 error LNK2019: unresolved external symbol __imp__DispatchMessageW@4 referenced in function _WinMain@16 SexyEngine1.obj
Error 2 error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _WinMain@16 SexyEngine1.obj
Error 3 error LNK2019: unresolved external symbol __imp__PeekMessageW@20 referenced in function _WinMain@16 SexyEngine1.obj
Error 4 error LNK2019: unresolved external symbol __imp__UpdateWindow@4 referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@QAEHH@Z) SexyEngine1.obj
Error 5 error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@QAEHH@Z) SexyEngine1.obj
Error 6 error LNK2019: unresolved external symbol __imp__CreateWindowExW@48 referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@QAEHH@Z) SexyEngine1.obj
Error 7 error LNK2019: unresolved external symbol __imp__GetSystemMetrics@4 referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@QAEHH@Z) SexyEngine1.obj
Error 8 error LNK2019: unresolved external symbol __imp__RegisterClassExW@4 referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@QAEHH@Z) SexyEngine1.obj
Error 9 error LNK2019: unresolved external symbol __imp__LoadIconW@8 referenced in function "public: int __thiscall SexyEngine::Initialize(int)" (?Initialize@SexyEngine@@QAEHH@Z) SexyEngine1.obj
Error 10 error LNK2019: unresolved external symbol __imp__DefWindowProcW@16 referenced in function "public: long __thiscall SexyEngine::HandleEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?HandleEvent@SexyEngine@@QAEJPAUHWND__@@IIJ@Z) SexyEngine1.obj
Error 11 error LNK2019: unresolved external symbol __imp__PostQuitMessage@4 referenced in function "public: long __thiscall SexyEngine::HandleEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?HandleEvent@SexyEngine@@QAEJPAUHWND__@@IIJ@Z) SexyEngine1.obj
Error 12 error LNK2019: unresolved external symbol __imp__EndPaint@8 referenced in function "public: long __thiscall SexyEngine::HandleEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?HandleEvent@SexyEngine@@QAEJPAUHWND__@@IIJ@Z) SexyEngine1.obj
Error 13 error LNK2019: unresolved external symbol __imp__BeginPaint@8 referenced in function "public: long __thiscall SexyEngine::HandleEvent(struct HWND__ *,unsigned int,unsigned int,long)" (?HandleEvent@SexyEngine@@QAEJPAUHWND__@@IIJ@Z) SexyEngine1.obj
Error 14 error LNK2019: unresolved external symbol __imp__ReleaseDC@8 referenced in function "void __cdecl GameActivate(struct HWND__ *)" (?GameActivate@@YAXPAUHWND__@@@Z) Storm.obj
Error 15 error LNK2019: unresolved external symbol __imp__DrawTextW@20 referenced in function "void __cdecl GameActivate(struct HWND__ *)" (?GameActivate@@YAXPAUHWND__@@@Z) Storm.obj
Error 16 error LNK2019: unresolved external symbol __imp__GetDC@4 referenced in function "void __cdecl GameActivate(struct HWND__ *)" (?GameActivate@@YAXPAUHWND__@@@Z) Storm.obj
Error 17 error LNK2019: unresolved external symbol __imp__GetClientRect@8 referenced in function "void __cdecl GameActivate(struct HWND__ *)" (?GameActivate@@YAXPAUHWND__@@@Z) Storm.obj
Error 18 error LNK2019: unresolved external symbol __imp__DrawIcon@16 referenced in function "void __cdecl GameCycle(void)" (?GameCycle@@YAXXZ) Storm.obj
Error 19 error LNK2019: unresolved external symbol __imp__GetClassLongW@8 referenced in function "void __cdecl GameCycle(void)" (?GameCycle@@YAXXZ) Storm.obj
Error 20 fatal error LNK1120: 19 unresolved externals C:\Documents and Settings\mads\Dokumenter\Visual Studio 2005\Projects\SexyEngine1\Debug\SexyEngine1.exe
•°*”˜˜”*°•.˜”*°•..•°*”˜.•°*”˜˜”*°•..•°*”˜˜”*°•.˜”*°•.˜”*°•. Mads .•°*”˜.•°*”˜.•°*”˜˜”*°•.˜”*°•..•°*”˜.•°*”˜.•°*”˜ ˜”*°•.˜”*°•.˜”*°•..•°*”˜I am going to live forever... or die trying!

This topic is closed to new replies.

Advertisement