Sign in to follow this  

unresolved yet defined

This topic is 4107 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

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 <windows.h> #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 <d3d8.h> 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; }

Share this post


Link to post
Share on other sites
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
};

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites

This topic is 4107 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.

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