wgois / OIS

Official OIS repository. Object oriented Input System
https://wgois.github.io/OIS/
zlib License
257 stars 86 forks source link

Exception: "No devices match requested type" when trying to call createInputObject #82

Closed Lwmte closed 2 years ago

Lwmte commented 2 years ago

After building OIS, I am encountering "No devices match requested type" exception when trying to createInputObject for either keyboard or joystick. While debugging, it seems that vendor optional argument always contains garbage instead of empty string.

I tried to force OIS source to always use empty string as vendor (ignoring an argument), but even if it creates both keyboard/joystick objects successfully, only keyboard works properly, while joystick has garbage data when looking at debug:

Clipboard 2

I suspect it's something related to building OIS itself using CMake/VS, but I tried both generating .sln in CMake, as well as building in VS directly, both x86 and x64 architecture.

I was trying to build OIS for Windows, using both VS2019 and VS2022, using latest OIS version (1.5.1).

Lwmte commented 2 years ago

Sorry for false alarm, I have found the reason for the bug. It seems that OIS requires separate lib/dll builds for debug/release, so I was using release lib build on a debug configuration of our app.

It'd be nice if OIS wouldn't differentiate between debug/release builds, it would prevent such confusion in future. Thanks!

Ybalrid commented 2 years ago

It seems that OIS requires separate lib/dll builds for debug/release, so I was using release lib build on a debug configuration of our app.

It'd be nice if OIS wouldn't differentiate between debug/release builds, it would prevent such confusion in future. Thanks!

The thing is, trying to avoid that causes issues if you go the other way around (using debug lib in a release build) due to miss-matched debug iterator levels / visual-studio STD libraries. You can end up with code that uses two different implementations of things provided to you by the visual studio STL (in your case, I guess std::string, std::vector, etc...)

There is not much to do to "fix" this nicely, it's a platform thing.