Quote:
Originally Posted by ehlochbr
I'm having a similar problem as described above. I'm trying to get the Logitech Gamepad to work with our robot. I've found the .h and .cpp files I need. I've included the .h file in the WPILib
|
I'll need more information to confirm, but I think your problem comes with the above statement.
I'm assuming that you took the gamepad .cpp and .h and put it in the WPILib directory, included it in your robot cpp file, built it and it failed at runtime. This is actually what I would expect because when you built, the compiler was able to find the gamepad.h file in the WPILib directory so it appeared to build fine. When the robot tried to run one of the gamepad specific members/methods, it failed because the gamepad class was never compile. Why? Because when you build your robot project, WPILib doesn't get rebuilt. Want proof? Go into your cpp file, take out a semicolon, and rebuild. You won't get an error.
In general I suggest not modifying WPILib directly or adding to it because if they come out with a new release, you will need to go in and make your change again.
The easy way to approach this problem is to take your gamepad files (both cpp and h) and put them directly in your project directory (you may need to right click on your project name and refresh the file list if you add it through Windows). When you rebuild your project, it will build up the gamepad files since it knows to build all cpp files.
Give that a shot and let us know how it goes