0

I am using the DirectXTK library for the gamepad class. I compiled the library with only this class inside it and it works.

If I would only add the source files to my project, without the library, the size would be ~50KB instead of ~500KB.

However, the Xbox One Controller is not detected using the source files without the library.

Any ideas on how to resolve this so my executable would be smaller in size?

Z0q
  • 1,689
  • 3
  • 28
  • 57
  • is that a disk space issue that is causing you trouble due to bulky executable? or you want to separate the library with the executable and still need that working (use DLL)? – Fahad Siddiqui Jan 20 '17 at 12:45
  • It is not really an issue, but I prefer to keep the size low and I like to learn more about how to do this. I think that it should be possible and it shouldn't be that difficult either. But I only need to figure out what I need to change to make it work. The entire application is only a few MB, so 500KB is a big part of it :) – Z0q Jan 20 '17 at 12:53
  • I presume there must be something different between using just the files and using them inside a library which causes it to behave differently – Z0q Jan 20 '17 at 12:55
  • yes there might be interdependencies. that is a possibility it isn't working correctly. how are you creating the binary file? you might use `-Os` flag if you are using `g++` to compile your code – Fahad Siddiqui Jan 20 '17 at 12:57
  • library code inside your project. this way the final binary will be optimized. – Fahad Siddiqui Jan 20 '17 at 13:03
  • I am using Microsoft Visual Studio targetting a Windows application – Z0q Jan 20 '17 at 13:10
  • Look at the implementation of ``GamePad``. It's just using either ``XINPUT`` or ``Windows.Gaming.Input`` (Windows 10 platforms). See [this blog post](https://blogs.msdn.microsoft.com/chuckw/2012/04/25/xinput-and-windows-8/). – Chuck Walbourn Jan 21 '17 at 04:23

0 Answers0