• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
MrSqweaky

C++ Linker error?

2 posts in this topic

[sub][i]Hello![/i][/sub]

[size=5][sub][i]I have a question for u guys, i have tried to compile my code for the two-kings.de tutorial, everthing worked fine until the second lesson. I see to have a strange linker error. tried to look up wich lib was causing this error, no succes so far. So i think u guys can help me out with this error, it bougles my mind :l[/i][/sub]

[sub][i]The error i get is this:[/i][/sub][/size]

[sub][i][code]1>capplication.obj : error LNK2019: unresolved external symbol "public: void __thiscall CApplication::CheckDeviceCaps(void)" (?CheckDeviceCaps@CApplication@@QAEXXZ) referenced in function "public: void __thiscall CApplication::InitD3D(void)" (?InitD3D@CApplication@@QAEXXZ)
1>C:\Users\Alx\Documents\Visual Studio 2008\Projects\twoking\Debug\twoking.exe : fatal error LNK1120: 1 unresolved externals[/code][/i][/sub]

[b]Here is my CApplication header[/b]
[code][size=2]]#ifndef capplication_h
#define capplication_h[/size]
[size=2]#include"main.h"[/size]
[size=2]class CApplication
{
public:
CApplication(void);
~CApplication(void);[/size]

[size=2]//win32 stuff
void InitWindow(void);
void SaveSettings(void);
void LoadSettings(void);
void KillWindow(void);[/size]
[size=2]//d3d stuff
void InitD3D(void);
void InitScene(void);
void CheckDeviceCaps(void);
bool CheckDevice(void);
void KillD3D(void);[/size]

[size=2]//win32 prototypes
inline bool GetWindowStatus(void)
{
return m_bRunningWindow;
}
inline HWND GetWindowHandle(void)
{
return m_hWindow;
}
inline void SetWindowStatus(bool bRunningWindow)
{
m_bRunningWindow = bRunningWindow;
}[/size]
[size=2]//d3d
inline bool GetD3DStatus(void)
{
return m_bRunningD3D;
}
inline LPDIRECT3DDEVICE9 GetDevice(void)
{
return m_pDirect3DDevice;
}
inline void SetD3DStatus(bool bRunningD3D)
{
m_bRunningD3D = bRunningD3D;
}[/size]


[size=2]//win32
private:
bool m_bRunningWindow,
m_bRunningD3D; [/size]
[size=2] HWND m_hWindow,
m_hBtnStart,
m_hBtnCancel,
m_hLblResolution,
m_hCbResolution,
m_hLblBackBuffer,
m_hCbBackBuffer,
m_hLblDepthStencil,
m_hCbDepthStencil,
m_hLblVertexProcessing,
m_hCbVertexProcessing,
m_hLblMultiSampling,
m_hCbMultiSampling,
m_hLblAnisotropy,
m_hCbAnisotropy;[/size]
[size=2] LPDIRECT3D9 m_pDirect3DObject;
LPDIRECT3DDEVICE9 m_pDirect3DDevice;
D3DPRESENT_PARAMETERS m_PresentParameters;
D3DCAPS9 m_DeviceCaps; [/size]
[size=2] DWORD m_dwWidth,
m_dwHeight,
m_dwVertexProcessing,
m_dwAnisotropy;
D3DFORMAT m_ColorFormat,
m_DepthStencilFormat;
D3DMULTISAMPLE_TYPE m_MultiSampling;[/size]
[size=2] D3DXMATRIX m_matProjection;
float m_fAspectRatio,
m_fFieldOfView,
m_fNearPlane,
m_fFarPlane;
};[/size]
[size=2]#endif[/size][/code]


[b]And here my CApplication cpp file[/b]
[size=2][code]#include "main.h"[/size]

[size=2]CApplication::CApplication(void)
{
m_pDirect3DObject = NULL;
m_pDirect3DDevice = NULL;[/size]
[size=2] m_dwWidth = 800;
m_dwHeight = 600;[/size]
[size=2] m_ColorFormat = D3DFMT_R5G6B5;
m_DepthStencilFormat = D3DFMT_D16;
m_dwVertexProcessing = D3DCREATE_SOFTWARE_VERTEXPROCESSING;
m_MultiSampling = D3DMULTISAMPLE_NONE;
m_dwAnisotropy = 0;[/size]
[size=2] m_fFieldOfView = D3DX_PI / 4.0f;
m_fNearPlane = 1.0f;
m_fFarPlane = 1000.0f;
m_fAspectRatio = (float)m_dwWidth / (float)m_dwHeight;[/size]
[size=2] m_bRunningWindow = true;
m_bRunningD3D = false;[/size]
[size=2] InitWindow();
}[/size]
[size=2]CApplication::~CApplication(void)
{
KillD3D();
KillWindow();
}[/size]
[size=2]void CApplication::InitWindow(void)
{
WNDCLASSEX screen;
RECT size;[/size]
[size=2]InitCommonControls();
GetClientRect(GetDesktopWindow(), &size);[/size]
[size=2]screen.cbSize = sizeof(WNDCLASSEX);
screen.style = CS_HREDRAW | CS_VREDRAW;
screen.lpfnWndProc = WindowProcedure;
screen.cbClsExtra = 0;
screen.cbWndExtra = 0;
screen.hInstance = GetModuleHandle(NULL);
screen.hIcon = NULL;
screen.hCursor = NULL;
screen.hbrBackground = GetSysColorBrush(COLOR_BTNFACE);
screen.lpszMenuName = NULL;
screen.lpszClassName = "Classname";
screen.hIconSm = LoadIcon(NULL, IDI_APPLICATION);[/size]
[size=2]RegisterClassEx(&screen);[/size]
[size=2]m_hWindow = CreateWindowEx(WS_EX_CONTROLPARENT,
"Classname",
TITLE,
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_VISIBLE,
((1650 / 2) - WINDOW_X) + (WINDOW_X / 100 * 55) ,
((1050 / 2) - WINDOW_Y) + (WINDOW_Y / 100 * 45) ,
WINDOW_X,
WINDOW_Y,
NULL,
NULL,
GetModuleHandle(NULL),
NULL);[/size]
[size=2]m_hLblResolution = CreateWindow("static",
"Hai:3",
WS_CHILD | WS_VISIBLE | SS_LEFT,
20,
20,
200,
18,
m_hWindow,
NULL,
(HINSTANCE)GetWindowLong(m_hWindow, GWL_HINSTANCE),
NULL);
SendMessage(m_hCbResolution,CB_ADDSTRING,0,(long)"640 x 480");
SendMessage(m_hCbResolution,CB_ADDSTRING,0,(long)"800 x 600");[/size]
[size=2]LoadSettings();
}[/size]
[size=2]void CApplication::InitD3D(void)
{
if((m_pDirect3DObject = Direct3DCreate9(D3D_SDK_VERSION)) == NULL)
{
MessageBox(m_hWindow, "[0x0]Failed to create Direct3D Object", "Init D3D", MB_OK);
m_bRunningD3D = false;
}
ZeroMemory(&m_PresentParameters, sizeof(m_PresentParameters));
m_PresentParameters.Windowed = false;
m_PresentParameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
m_PresentParameters.EnableAutoDepthStencil = true;
m_PresentParameters.AutoDepthStencilFormat = m_DepthStencilFormat;
m_PresentParameters.hDeviceWindow = m_hWindow;
m_PresentParameters.BackBufferWidth = m_dwWidth;
m_PresentParameters.BackBufferHeight = m_dwHeight;
m_PresentParameters.BackBufferFormat = m_ColorFormat;
m_PresentParameters.MultiSampleType = m_MultiSampling; [/size]
[size=2]if(FAILED(m_pDirect3DObject->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,m_hWindow,m_dwVertexProcessing,&m_PresentParameters,&m_pDirect3DDevice)))
{
MessageBox(m_hWindow, "[0x1]Failed to create Direct3D Device", "Init D3D", MB_OK);
m_bRunningD3D = false;
}
ShowCursor(false);[/size]
[size=2]InitScene();
CheckDeviceCaps();
}
void CApplication::InitScene(void)
{
D3DXMatrixPerspectiveFovLH(&m_matProjection, m_fFieldOfView,m_fAspectRatio,m_fNearPlane,m_fFarPlane);
m_pDirect3DDevice->SetTransform(D3DTS_PROJECTION,&m_matProjection);[/size]
[size=2]for(unsigned i = 0;i < 8;++i)
{
m_pDirect3DDevice->SetSamplerState(i,D3DSAMP_MINFILTER,D3DTEXF_LINEAR);
m_pDirect3DDevice->SetSamplerState(i,D3DSAMP_MAGFILTER,D3DTEXF_LINEAR);
m_pDirect3DDevice->SetSamplerState(i,D3DSAMP_MIPFILTER,D3DTEXF_ANISOTROPIC);
m_pDirect3DDevice->SetSamplerState(i,D3DSAMP_MAXANISOTROPY,m_dwAnisotropy);
}
}[/size]
[size=2]bool CApplication::CheckDevice(void)
{
switch(m_pDirect3DDevice->TestCooperativeLevel())
{
case D3DERR_DEVICELOST:
{
MessageBox(m_hWindow,"[0x2]Device has been lost","CheckDevice()",MB_OK);
return false;
}
case D3DERR_DEVICENOTRESET:
{
if(FAILED(m_pDirect3DDevice->Reset(&m_PresentParameters)))
{
MessageBox(m_hWindow,"[0x3]Device failed to reset","CheckDevice()",MB_OK);
return false;
}
return true;
}
default: return true;
}
}[/size]
[size=2]void CApplication::KillD3D(void)
{
if(m_pDirect3DDevice != NULL)
{
m_pDirect3DDevice->Release();
m_pDirect3DDevice = NULL;
}
if(m_pDirect3DObject != NULL)
{
m_pDirect3DObject->Release();
m_pDirect3DObject = NULL;
}[/size]
[size=2]}[/size]
[size=2]void CApplication::LoadSettings(void)
{
} [/size]
[size=2]void CApplication::SaveSettings(void)
{
} [/size]
[size=2]void CApplication::KillWindow(void)
{
UnregisterClass("ClassName",GetModuleHandle(NULL));
} [/code][/size]
0

Share this post


Link to post
Share on other sites
You don't seem to have a function definition for your CheckDeviceCaps() function.
1

Share this post


Link to post
Share on other sites
[quote name='SiCrane' timestamp='1328481129' post='4909950']
You don't seem to have a function definition for your CheckDeviceCaps() function.
[/quote]

The tutorial said we will be covering that on a later stage of our programming course.

What u saying is just add the function definition
[code]CApplication::CheckDeviceCaps(void)
{
//Do Nothing.
}[/code]

[b]Edit: Worked fine, tutorial actually didnt say u need to define that:)[/b]
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0