Hi! I am a programmer for team 1086, and we were trying to run last years code in eclipse. However, we have 76 errors worth of UINTs not work. Quick sample below of our drive motors. We used the UINTs for all solenoids and motors and sensors on the robot, and don’t know why it isn’t working in eclipse. Any assistance is thankful. We program in C++. The exact error is
Type ‘UINT32’ could not be resolved
Thanks,
Zach
//drive motors
static const UINT32 LEFT_FRONT = 1;
static const UINT32 LEFT_REAR = 2;
static const UINT32 RIGHT_FRONT = 3;
static const UINT32 RIGHT_REAR = 4;
We noticed this too when we copied in an old gamepad utility class. UINT32 and its ilk are not built-in C++ types; they’re part of WPILib. If you dug around you might be able to find a file with “typedef UINT32 unsigned int” or something like that. As best I can tell, WPILib no longer uses the “UINT32” style of names for these types. Now they write them like “uint32_t”, which is more typical style for naming custom types.
Technically speaking, C++ types such as “int” do not correspond to a specified amount of memory, although in practice int is always 32-bit. The WPILib people want a more a clear/unambiguous system, so they define their own type names, like UINT32 or uint32_t instead of “unsigned int”.
There’s no reason to use that in your code though; just replace all your UINT’s with int or unsigned int. ctrl-f followed by “replace all” is how we did it.
Yeah we had the same problem too, Like another poster mentioned, you could just replace the values to unsigned int or include <cstdint> and change them all to uint32_t’s if you really want that data type.
Teams are likely to run into the basic Arduino boards which have 16 bit ints. And ILP64 (64 bits for int, long, and pointer) systems exist too, though they are more unusual.