JibbSmart / JoyShockLibrary

Read DualSense, DualShock 4, JoyCon, and Pro Controller input on PC -- compiled for Windows, but code should work on other platforms.
Other
240 stars 48 forks source link

Move declarations to header files #19

Closed RollinBarrel closed 3 years ago

RollinBarrel commented 3 years ago

VS spits out a lot of "redeclaration" errors, unless you compile JSL using CMake-generated project 😵 With these, it's now possible to compile directly via Visual Studio project, without CMake I need those changes so i can compile JSL inside my VS solution - though it's totally fine to just keep them in my fork

I feel like there should've been an easier way

gnrlwart commented 3 years ago

I feel like there should've been an easier way

If you look at the CMakeLists.txt file, JoyShockLibrary.cpp is the only included cpp file. The problem can be resolved by setting the ExcludedFromBuild property to true for the other cpp files (InputHelpers.cpp, JoyShock.cpp, tools.cpp) Doing that, adding setupapi.lib as a linker input will get the VS project compiling in Release.

I have this change working locally, so let me know if you'd like me to make a pull request of it.

RollinBarrel commented 3 years ago

Ah, i see 😅 This got it working, thanks! I've changed my project to build JSL from master, going to leave this PR open for now in case changes here could be used