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: Linker errors on console demo  (Read 4566 times)

Thordon

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 13
    • View Profile
Linker errors on console demo
« on: April 01, 2006, 08:19:04 AM »

Edit: Oops, just realised that I need to build the lib >_>, never mind :)

Edit2: Hmm, "Contains gcc CodeBlocks target build project (Not Working Yet)", Im totally lost, is it not possible then? Ive never built a library from source before
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Linker errors on console demo
« Reply #1 on: April 01, 2006, 09:33:50 AM »

The Code::Blocks solution is not working/upto date. However, it should work if you add all the required project files to the build (for Win32, that is all OIS files, and all files in the src/win32). Plus, setup the proper include directories, and link against the correct DirectInput libs... There, may still, be one problem that needs to be solved. I remember that Ogre had some code::block's/gcc specific thing with DirectInput having to adjust the offset size of the structures (tis would apply to Mouse/Keyboard/Joystick). You could look at Ogre source for such things, if you wanted to fix OIS and submit a patch :)
Logged

Thordon

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 13
    • View Profile
Linker errors on console demo
« Reply #2 on: April 01, 2006, 10:33:38 AM »

I did what you said to the letter, and yeah, I got stuck on something to do with FIELD_OFFSET, Im not touching Ogre yet though.

Code: [Select]
..\..\ois_0-5-0-Windows\ois\src\win32\Win32JoyStick.cpp:290: error: a casts to a type other than an integral or enumeration type cannot appear in a constant-expression

Edit: Odd, that error came up when using MiniGW as the compiler, but I tried switching to VC++ 2003 Toolkit and it seemed to compile fine, OIS.lib file outputted, Ill try using it.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Linker errors on console demo
« Reply #3 on: April 01, 2006, 10:40:38 AM »

Yeah, it is just a size/type thing with the gcc compiler. And, I would expect it to work perectly fine when usig .net compiler :D
Logged

Thordon

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 13
    • View Profile
Linker errors on console demo
« Reply #4 on: April 01, 2006, 10:50:26 AM »

Im still getting linker errors, which libs do I need from DirectInput? Im trying dinput.lib and dinput8.lib
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Linker errors on console demo
« Reply #5 on: April 01, 2006, 10:52:36 AM »

dxguid.lib dinput8.lib Is all I link against on the Win32 VC builds.
Logged

Thordon

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 13
    • View Profile
Linker errors on console demo
« Reply #6 on: April 01, 2006, 11:05:29 AM »

I think Im just making some noob mistake here  :lol: , no matter what I link/include, I keep getting the same errors:

Edit: Got rid of the sidescroll
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Linker errors on console demo
« Reply #7 on: April 01, 2006, 02:53:54 PM »

You seem to be missing several other libs (that are linked in by default by MSVC)... Perhaps the free .net compiler is like the VC8 Express, where you need to link to other default window libs specifically.

Coredll.lib
User32.lib

Maybe some others. Best bet, is to take each unresolved symbol, and look at msdn for what lib is needed.
Logged

Thordon

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 13
    • View Profile
Linker errors on console demo
« Reply #8 on: April 01, 2006, 03:52:04 PM »

Aye, I noticed some of them looked like windows functions, so I linked User32.lib and that cleaned up some. I looked up DirectInput8Create and its definetely supposed to be in dinput8.lib. I went back and looked at the file I was linking, I linked the one in lib/x64 (I figured that would be better for my cpu, an A64), I switched to the x86 one and everything worked fine (apart from a coop error Im not going to start trying to solve now :)), so I guess I was just making a noob mistake :)

Thanks for all the help :)
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Linker errors on console demo
« Reply #9 on: April 01, 2006, 04:39:12 PM »

Well, if you are running WinXP64 (or a vista 64 beta), than I cannot help you - you should be linking to whatever 64 bit libs of the platform you need. But, if you only have a 64bit CPU and are using a normal windows version, then you should link against regular 32 Bit libs.

As for the Coop error, if this is on the demo, then it is because you linking against the 32 bit version of DX, and are using the 64Bit runtime. I would guess.
Logged

Thordon

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 13
    • View Profile
Linker errors on console demo
« Reply #10 on: April 02, 2006, 06:14:56 AM »

I am using Windows XP, which is 32 bit, so I should be linking against the x86 libs then? And about the runtime, do you mean a DirectX runtime? How would I know if it was 32 bit or 64 bit? Can I change it?
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Linker errors on console demo
« Reply #11 on: April 02, 2006, 08:58:00 AM »

If you are running 32 Bit OS, then DX would be using the 32 Bit runtime. It would only use the 64Bit runtime in a 64 bit environment.

So, if you are using 32Bit OS, everything you link against should be compiled in 32Bit mode. No matter that you have a 64Bit proessor. From what I've heard anyway, 64 Bit windows is still very unstable anyway. To really use that 64Bit processor to it's full advantage, your best bet would be Linux :wink:
Logged

Thordon

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 13
    • View Profile
Linker errors on console demo
« Reply #12 on: April 02, 2006, 09:21:19 AM »

Thats not a change I can make at this stage of my project :)

If its not the runtime, can you guess as to why Im getting the coop error then?
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +1/-0
  • Posts: 2661
    • View Profile
    • http://www.wreckedgames.com
Linker errors on console demo
« Reply #13 on: April 02, 2006, 09:23:41 AM »

You never really answered my question. Does it do this on the demo?

If not, then I think you are setting up invalid params during the creation of the InputManager. If you (for example) are setting some DX Flags (like NON_EXCLUSIVE or EXCLUSIVE) and not setting the cooperative mode to (ie. BACKGROUND or FOREGROUND), you will get this error.
Logged

Thordon

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 13
    • View Profile
Linker errors on console demo
« Reply #14 on: April 02, 2006, 09:27:50 AM »

Sorry, yes, in the demo (FFConsoleDemo.cpp), the exception points to this in the source:

Code: [Select]
if(FAILED(mKeyboard->SetCooperativeLevel( hwin, coopSetting)))
OIS_EXCEPT( E_General, "Win32Keyboard::Win32Keyboard >> coop error!");
Logged
Pages: [1] 2