Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: [Linker error] undefined reference to OIS::InputManager::createInputSystem  (Read 707 times)

Sindarin

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 2
    • View Profile

Hello, I am trying to create a wrapper dll to use OIS with my games but as soon as I try to initialize it, I get this linker error

Quote
[Linker error] undefined reference to `OIS::InputManager::createInputSystem(unsigned int)'

My source:

Code: [Select]
#include "dll.h"
#include <windows.h>

#define OIS_DYNAMIC_LIB
#include "OIS.h"

#include <iostream>
#include <vector>
#include <sstream>

/* OIS SPECIFIC */
using namespace OIS;

const char *g_DeviceType[6] = {"OISUnknown", "OISKeyboard", "OISMouse", "OISJoyStick",
"OISTablet", "OISOther"};

InputManager *g_InputManager = 0;
Keyboard *g_kb  = 0;
JoyStick* g_joys[4] = {0,0,0,0};
ForceFeedback* g_ff[4] = {0,0,0,0};
/* end of OIS SPECIFIC */

HWND hWnd = 0;

/* sin_input_init() */
export double sin_input_init(double handle)
{
      
 OIS::ParamList pl;
 hWnd = (HWND)(int)handle;

 std::ostringstream wnd;
 wnd << (size_t)hWnd;

 pl.insert(std::make_pair( std::string("WINDOW"), wnd.str() ));

 g_InputManager = OIS::InputManager::createInputSystem(pl);
 InputManager &im = *g_InputManager;
 
 return 1;
  
}

Any help please?
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2653
    • View Profile
    • http://www.wreckedgames.com

The client application may still need to link against OIS.lib - not just the wrapper.
Logged

Sindarin

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 2
    • View Profile

Oh, that's a compiler error, not application apparently.

Also I am developing on Windows, do I still need to link the lib for some reason?
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2653
    • View Profile
    • http://www.wreckedgames.com

Yes, when using a DLL and including the header files, you will need to link to the import lib (not the static lib).
Logged