OldSchoolHack

Register / Login English

error LNK2001

icon Thread: [Help] error LNK2001

Join Date: Sep 2013

Posts: 5

User-Rating:

1 positive
0 negative
error 
LNK2001


: unresolved external symbol "public: __thiscall OSHGui:rawing::RendererDX9::RendererDX9(struct IDirect3DDevice9 *)" (??0RendererDX9@Drawing@OSHGui@@QAE@PAUIDirect3DDevice9@@@Z)
TEXT Code:
  1. #define WIN32_LEAN_AND_MEAN
  2. #define NOMINMAX
  3. #include <windows.h>
  4. #include <Shellapi.h>
  5. #include <d3dx9.h>
  6.  
  7. #undef MessageBox
  8. #include <iostream>
  9. #include <sstream>
  10. #include <memory>
  11. #pragma comment(lib, "d3d9.lib")
  12. #pragma comment(lib, "d3dx9.lib")
  13. #pragma  comment(lib,"oshgui.lib")
  14. //---------------------------------------------------------------------------
  15. #include "OSHGui.hpp"
  16. #include "DrawingDirect3D9RendererDX9.hpp"
  17. #include "InputWindowsMessage.hpp"
  18. //#include "DrawingDirect3D9RendererDX9.cpp"
  19. //---------------------------------------------------------------------------
  20. using namespace OSHGui;
  21. //---------------------------------------------------------------------------
  22. LPDIRECT3D9 pD3D = nullptr;
  23. LPDIRECT3DDEVICE9 pDevice = nullptr;
  24. D3DPRESENT_PARAMETERS pp;
  25. Input::WindowsMessage input;
  26. class MainForm : public Form
  27. {
  28. private:
  29. LinkLabel *linkLabel;
  30. void InitializeComponent()
  31. {
  32. this->SetText("OldSchoolHack GUI by KN4CK3R");
  33. this->SetSize(Drawing::Size(218, 289));
  34. linkLabel = new LinkLabel();
  35. linkLabel->SetName("linkLabel");
  36. linkLabel->SetLocation(Drawing::Point(3, 9));
  37. linkLabel->SetText("visit www.oldschoolhack.me);
  38. linkLabel->GetClickEvent() += ClickEventHandler(std::bind(&MainForm::linkLabel_Click, this, std::placeholders::_1));
  39. this->AddControl(linkLabel);
  40. }
  41. public:
  42. MainForm() : Form()
  43. {
  44. InitializeComponent();
  45. }
  46. void linkLabel_Click(Control *control)
  47. {
  48. ShellExecute(0, "open", "www.oldschoolhack.de", NULL, NULL, SW_SHOWNORMAL);
  49. }
  50. };
  51. //---------------------------------------------------------------------------
  52. HRESULT D3DInit(HWND hwnd)
  53. {
  54. srand(GetTickCount());
  55. if (!(pD3D = Direct3DCreate9(D3D_SDK_VERSION)))
  56. {
  57. return E_FAIL;
  58. }
  59. RECT ClientRect;
  60. GetClientRect(hwnd, &ClientRect);
  61. ZeroMemory(&pp, sizeof(pp));
  62. pp.SwapEffect = D3DSWAPEFFECT_DISCARD;
  63. pp.BackBufferFormat = D3DFMT_X8R8G8B8;
  64. pp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT;
  65. pp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
  66. pp.Windowed = TRUE;
  67. pp.BackBufferWidth = ClientRect.right;
  68. pp.BackBufferHeight = ClientRect.bottom;
  69. if (FAILED(pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hwnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &pp, &pDevice)))
  70. {
  71. return E_FAIL;
  72. }
  73. ::ShowCursor(false);
  74. D3DXMATRIX Projection;
  75. D3DXMatrixPerspectiveFovLH(&Projection, D3DXToRadian(45.0f), 584.0f / 562.0f, 1.0f, 100.0f);
  76. pDevice->SetTransform(D3DTS_PROJECTION, &Projection);
  77. Application::Instance()->Create(new Drawing::RendererDX9(pDevice)); //create Application
  78. Application::Instance()->Run(std::shared_ptr<Form>(new MainForm())); //set our mainform
  79. Application::Instance()->Enable(); //enable GUI
  80. return S_OK;
  81. }
  82. //---------------------------------------------------------------------------
  83. void D3DRender()
  84. {
  85. if(!pDevice)
  86. {
  87. return;
  88. }
  89. pDevice->Clear(0, 0, D3DCLEAR_TARGET, 0xFF123456, 1.0f, 0);
  90. pDevice->BeginScene();
  91. Application::Instance()->GetRenderer()->Begin(); //begin rendering
  92. Application::Instance()->GetRenderer()->SetRenderRectangle(Drawing::Rectangle(0, 0, 700, 400)); //set the rendering size
  93.  
  94. //render stuff
  95. Application::Instance()->Render(); //render gui
  96. Application::Instance()->GetRenderer()->End(); //end rendering
  97. pDevice->EndScene();
  98. pDevice->Present(0,0,0,0);
  99. }
  100. //---------------------------------------------------------------------------
  101. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
  102. {
  103. WNDCLASS wc;
  104. ZeroMemory(&wc, sizeof(wc));
  105. wc.style = CS_CLASSDC;
  106. wc.lpfnWndProc = DefWindowProc;
  107. wc.hInstance = GetModuleHandle(0);
  108. wc.lpszClassName = "OSHGui";
  109. wc.hCursor = LoadCursor(0, IDC_ARROW);
  110. RegisterClass(&wc);
  111. HWND hwnd = CreateWindowA("OSHGui", "OSHGui", WS_OVERLAPPEDWINDOW, 100, 100, 700, 400, GetDesktopWindow(), 0, wc.hInstance, 0);
  112. if (SUCCEEDED(D3DInit(hwnd)))
  113. {
  114. ShowWindow(hwnd, SW_SHOWDEFAULT );
  115. UpdateWindow(hwnd);
  116. MSG msg;
  117. ZeroMemory(&msg, sizeof(msg));
  118. while (true)
  119. {
  120. if (!IsWindowVisible(hwnd))
  121. break;
  122. if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
  123. {
  124. input.ProcessMessage(&msg);
  125. if (msg.message == WM_QUIT)
  126. break;
  127. TranslateMessage(&msg);
  128. DispatchMessage(&msg);
  129. }
  130. else
  131. {
  132. D3DRender();
  133. }
  134. }
  135. }
  136. if(pDevice)
  137. {
  138. pDevice->Release();
  139. }
  140. if(pD3D)
  141. {
  142. pD3D->Release();
  143. }
  144. UnregisterClass("OSHGui", wc.hInstance);
  145. return 0;
  146. }

I get this error...
how can i fix it??