Skip to main content
gamedev.net
🔒 Locked

unresolved yet defined

Started by Nikita21 5 replies 850+ views
Original Post
Nikita21
Nikita21
Hey, I am not sure if this is the right place to post, for this problem releted to directX and General programming. its seems to be i defined few basic commands and included them yet i get these errors... **************************ERRORS************************************ mainproc.obj : error LNK2001: unresolved external symbol "public: void __thiscall illNewWindow::run(void)" (?run@illNewWindow@@QAEXXZ) mainproc.obj : error LNK2001: unresolved external symbol "public: enum illError32 __thiscall illNewWindow::Create(struct HINSTANCE__ *,char *,int,int,unsigned long)" (?Create@illNewWindow@@QAE?AW4illError32@@PAUHINSTANCE__@@PADHHK@Z) mainproc.obj : error LNK2001: unresolved external symbol "public: virtual enum illBool32 __thiscall illNewWindow::MessageHandler(unsigned int,unsigned int,long)" (?MessageHandler@illNewWindow@@UAE?AW4illBool32@@IIJ@Z) mainproc.obj : error LNK2001: unresolved external symbol "public: __thiscall illNewWindow::illNewWindow(void)" (??0illNewWindow@@QAE@XZ) mainproc.obj : error LNK2001: unresolved external symbol "public: __thiscall illNewWindow::~illNewWindow(void)" (??1illNewWindow@@QAE@XZ) Debug/wincpro.exe : fatal error LNK1120: 5 unresolved externals **************************************************************************** #include #include "illwinddef.h" #pragma once class illNewWindow { protected: WNDCLASS illWind; HWND illa2wind; MSG ill2Msg; public: illNewWindow(void); ~illNewWindow(void); void run(void); //The Secondery header file - resmain.h static LRESULT CALLBACK WndProc(HWND hWindow, UINT iMessage, WPARAM wParam, LPARAM lParam); //Create(HINSTANCE hInstance, LPSTR szTitle, illInt iWidth = CW_USEDEFAULT, illInt iHeight = CW_USEDEFAULT); illError32 Create(HINSTANCE hInstance, LPSTR szTitle, illInt iWidth = CW_USEDEFAULT, illInt iHeight = CW_USEDEFAULT, illUInt32 istyle = WS_OVERLAPPEDWINDOW | WS_VISIBLE); virtual illBool32 MessageHandler(UINT iMessage, WPARAM wParam, LPARAM lParam); virtual illBool32 Frame(void) = 0; }; //The primary main file - mainproc #include "resmain.h" #include "illwinddef.h" #include class D3DWindow : public illNewWindow { LPDIRECT3D8 m_pD3D; LPDIRECT3DDEVICE8 m_pD3DDevice; public: D3DWindow(void) {}; ~D3DWindow(void) {}; HRESULT SetupDirect3D(void); HRESULT KillDirect3D(void); illBool32 Frame(void); }; HRESULT D3DWindow::SetupDirect3D (void) { if(NULL == (m_pD3D = Direct3DCreate8(D3D_SDK_VERSION) ) ) { return E_FAIL; } D3DDISPLAYMODE d3ddm; if(FAILED(m_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm) ) ) { return E_FAIL; } D3DPRESENT_PARAMETERS d3dpp; ZeroMemory(&d3dpp, sizeof(d3dpp) ); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.BackBufferFormat = d3ddm.Format; if(FAILED(m_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, illa2wind, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &m_pD3DDevice) ) ) { return E_FAIL; } return D3D_OK; } HRESULT D3DWindow::KillDirect3D(void) { if(NULL != m_pD3D) { m_pD3D->Release(); } if(NULL != m_pD3DDevice) { m_pD3DDevice->Release(); } return D3D_OK; } illBool32 D3DWindow::Frame(void) { m_pD3DDevice->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 255), 1.0f, 0); m_pD3DDevice->BeginScene(); m_pD3DDevice->EndScene(); m_pD3DDevice->Present(NULL, NULL, NULL, NULL); return illTrue; } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nShowCmd) { D3DWindow ildxWindow; ildxWindow.Create(hInstance, "Ground Zer0"); ildxWindow.SetupDirect3D(); ildxWindow.run(); ildxWindow.KillDirect3D(); return 0; }
jflanglois
jflanglois
You're going to have to post illwindef.h and post between source tags. Also, where is your implementation of illNewWindow?
Nikita21
Nikita21
Perdon but i am a so called Begineer in the whole programming field,
will you be kind enough to tell me what execly is implementation,
i mean what execly do you reffer to...


// Illasera Basic definations - illwindef.h

#pragma once

typedef char illInt8;
typedef unsigned char illUInt8;
typedef short illInt16;
typedef unsigned short illUInt16;
typedef long illInt32;
typedef unsigned long illUInt32;
typedef int illInt;
typedef unsigned int illUInt;
typedef float illReal32;
typedef double illReal64;

enum illBool32
{
illFalse = 0,
illTrue = 1,
illBool32_Force32 = 0xFFFFFFFF
};

enum illError32
{
illNoError = 0,
illError32_Force32 = 0xFFFFFFFF
};
jflanglois
jflanglois
Quote:
Original post by Nikita21
will you be kind enough to tell me what execly is implementation


The implementation of a class or function is the code that actually defines (for lack of a better word) what it does. So for example:

Definition:
int Double( int i );

Implementation:
int Double( int i ) {
return 2 * i;
}


Your linker errors have to do with the linker not being able to find the implementation of illNewWindow's member functions. So, do you have the implementation somewhere? And if so, where?


jfl.
Nikita21
Nikita21
mainproc.obj : error LNK2001: unresolved external symbol "public: __thiscall illNewWindow::illNewWindow(void)" (??0illNewWindow@@QAE@XZ)
mainproc.obj : error LNK2001: unresolved external symbol "public: __thiscall illNewWindow::~illNewWindow(void)" (??1illNewWindow@@QAE@XZ)
Debug/wincpro.exe : fatal error LNK1120: 2 unresolved externals

//definations
illNewWindow(void);
~illNewWindow(void);

//Implementation:
illNewWindow::illNewWindow(void)
{
}

illNewWindow::~illNewWindow(void)
{
}

Is this the right way to solve these 2 errors above?
jflanglois
jflanglois
Well, no. If you don't plan on implementing anything in the constructor and destructor, then just omit them from the class definition. The compiler will generate them for you.
Nypyren
Nypyren
You probably are just forgetting to link to the Illasera library. I've never heard of it, so I don't know if it's a publicly available library or something you wrote.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.