Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Pages: [1] 2

Author Topic: xcode undefined symbol error  (Read 3252 times)

robtherich

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 8
    • View Profile
xcode undefined symbol error
« on: July 11, 2006, 07:14:36 PM »

hello.

i am trying to incorporate ois into my existing xcode application.
the ois static library seemed to build with no problems using the xcode 2.2 file.

i moved the library to my /usr/local/lib folder and the header files (including the mac specific ones) to /user/local/include. i added the ois library to my project and tried to build.  it compiles fine, but upon linking i get an undefined symbol error for "OIS::MacInputManager::MacInputManager()"

i tried including those mac headers directly in my project, but this did not help.

does anyone have any suggestions?

many thanks.
-rob
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
xcode undefined symbol error
« Reply #1 on: July 11, 2006, 09:16:35 PM »

Sorry, i do not have access to a OSX machine, and did not verify the Mac SDL port myself. It appears that you are missing a define for OIS_SDL_PLATFORM. As, the native mac port is not finished (The MacInputManager) you should be using the SDLInputManager class. Which is brought in by that define. Can you verify the (I do not know xcode at all) Xcode project (the 2.2 one of course) has that define in the build steps for OIS?

It only needs to be in the build of OIS, not in your project, as it is only used in OIS source file to bring in the proper input manager system. And, if that is the problem, if you wouldn't mind creating a patch file for the XCode 2.2 project, I'd be greatful :)
Logged

robtherich

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 8
    • View Profile
xcode undefined symbol error
« Reply #2 on: July 20, 2006, 10:49:08 AM »

thanks for the reply. sorry for taking so long to reply back, i was out of town.

that did the trick.  changed OISInputManager.cpp as such...

Code: [Select]
#elif defined OIS_APPLE_PLATFORM
//#  include "mac/MacInputManager.h"
#  include "SDL/SDLInputManager.h"


Code: [Select]
#elif defined OIS_APPLE_PLATFORM
// im = new MacInputManager();
im = new SDLInputManager();


i'm not sure how or where to submit the patch, but i would be happy to if you let me know.

thanks again.
-rob
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
xcode undefined symbol error
« Reply #3 on: July 20, 2006, 10:53:00 AM »

You shouldn't have to change any cpp files. As, if you define OIS_SDL_PLATFORM in your project settings somewhere then that will be used before instead of the MAC define, and will being in the right header/lib.

Seems to me, that the project file might not be setup right.. Is there no way to add OIS_SDL_PLATFORM define to an xcode project?

I know, in Linux, it can be added in the configure scripts (whiich ends up putting it in the gcc comand line like: g++ -DOIS_SDL_PLATFORM).. And in windows, using visual studio, you add it to the project settings under preprocessor settigns. Let me know if you can't find where to send it, then I'll PM the XCode 2 project files submitter to maybe take a look (if he has time) - Sinbad's a very busy guy right now :)
Logged

robtherich

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 8
    • View Profile
xcode undefined symbol error
« Reply #4 on: July 20, 2006, 11:40:25 AM »

ok, i changed the target build settings and added OIS_SDL_PLATFORM as a preprocessor macro, which had the same effect as the edits i previously made.

again, still not sure how or where to submit the xcode project patch.

another question.  my project now builds fine, but i'm getting some exceptions.  in the demo code for the windows ogre/ois demo i found the following:
Code: [Select]
#if defined OIS_WIN32_PLATFORM
win->getCustomAttribute("HWND", &windowHnd);
#elif defined OIS_LINUX_PLATFORM
win->getCustomAttribute("GLXWINDOW", &windowHnd);


do i need to do something similar to this on the mac,  or is this just specific to windows and linux?

many thanks, once again.
-rob
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
xcode undefined symbol error
« Reply #5 on: July 20, 2006, 12:05:00 PM »

To submit a patch, Ogre site has good info on how to submit patches in many ways:
http://www.ogre3d.org/index.php?option=com_content&task=blogcategory&id=74&Itemid=87

Then, just upload to the www.sourceforge.net/projects/wgois patch tracker.

As for the demo issues.. What exceptions are you getting? Can you step into OIS to see what is happening - this really sounds like you are going to be the first actual person to get OIS working in OSX.

As for the ifdef for linux and windows, OSX does nto need that when using the SDL backend. OIS just tries to use the already initialised SDL system (it does check for SDL already being inited). So, it doesn't use any Window handles, as SDL only allows for One window.
Logged

robtherich

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 8
    • View Profile
xcode undefined symbol error
« Reply #6 on: July 20, 2006, 12:49:44 PM »

okay i'll let you know how it goes.

i submitted a patch
i think i did it right.

thanks again.
-rob
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
xcode undefined symbol error
« Reply #7 on: July 20, 2006, 04:04:41 PM »

Thanks for submitting the patch :)
Logged

robtherich

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 8
    • View Profile
xcode undefined symbol error
« Reply #8 on: July 21, 2006, 09:49:15 AM »

i'm now trying to run the OISConsole demo.
everything builds fine, but when i run, i get the following exeption:

SDLInputManager::SDLInputManager >> SDL Not Initialized already!

any thoughts to put me in the right direction?

-rob
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
xcode undefined symbol error
« Reply #9 on: July 21, 2006, 10:02:36 AM »

Ok, the OIS Console demo is not setup to work properly with the OIS-SDL manager. You should be easily able to modify it to create an SDL Window when using the SDL_PLATFORM.

OIS when using the SDL backend, does not init SDL at all.. It is meant to be used with other SDL applications, namely, it was made for using with Ogre under OSX, which should be initing and using SDL inside it.

Of course, I am not sure of the status of the Ogre-SDL-OSX platform, you may have to wait to get that working with OIS, as it has not been tested yet. Or, figure out what the issue is there.
Logged

robtherich

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 8
    • View Profile
xcode undefined symbol error
« Reply #10 on: July 25, 2006, 12:28:48 PM »

had some more time to try and get this working, so i thought i'd let you know how it goes.  still a no go getting input from OIS on my mac.

i have a simple project set up with a simple input manager and listener.  right now it just spits out a log message if it receives keyboard input.  but it is not working.

i stepped through in debug mode.  each frame started event, the mouse and keyboard call capture. that seems to work fine, but no input is received.

i tested the exact code on windows and it works fine. mouse and keyboard events reported.

do you have any suggestions about how to get this working?  i'm not sure where to go from here.

thanks.
-rob
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
xcode undefined symbol error
« Reply #11 on: July 25, 2006, 12:45:46 PM »

So, you have setup SDL properly?

There is a Win32 SDL demo, which consists of a bunch of Win32 specific stuff. But, you should be able to compare the SDL startup code there, to the startup code you are using and see if you are setting up SDL correctly. (ois/Win32/SDL/SDLDemo )

Also, once you manage to get the command line demo working (if that is the one you are using), I would love if you could sent in a patch (of course, using #ofdef OIS_MAC_PLATFORM) type of things.. And then, add the console demo to the SDL xcode projects.

Let me know what you find differs about the win32 code, and what you are using. I am here to help get this working right :)
Logged

robtherich

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 8
    • View Profile
xcode undefined symbol error
« Reply #12 on: July 25, 2006, 02:11:53 PM »

hmm, i thought from your previous reply that SDL was set up automatically when used as a backend to an os x ogre app.

i have pretty much ignored that stuff up to now.  i will take a look at the sdldemo and see what i can find.  i abandoned the console demo, and i am just working on my test project, which as i mentioned, works in windows.

i'll let you know.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
xcode undefined symbol error
« Reply #13 on: July 25, 2006, 02:42:15 PM »

Yes, SDL should be setup by Ogre. However, perhaps the SDL from Ogre is stealing the input events. Which, it probably is. now that I think about it.
Logged

robtherich

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 8
    • View Profile
xcode undefined symbol error
« Reply #14 on: July 25, 2006, 03:26:31 PM »

well i'm definitely over my head.  

i tried initing sdl as per the win32 demo, but it didn't change anything and it caused an opengl exception when it tried to load meshes. however it did seem to get through that init process.

i looked at some ogre source code for kicks.  i don't know how ogre sdl would be stealing events because i haven't created an Ogre EventProcessor, which is i think how the OgreSDLInput gets initialized.  so i can't tell where in ogre sdl input is getting setup to do the stealing.

i am more than happy to try out any suggestions you may have to get this working, but most of this is beyond me.
Logged
Pages: [1] 2