RobotBuilder not including headers for Default Commands

We were having trouble getting our RobotBuilder generated code to compile. Whenever we set a default command for a subsystem, we would get an error:


void Elevator::InitDefaultCommand() {
	// Set the default command for a subsystem here.
	//setDefaultCommand(new MySpecialCommand());
	// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND
	SetDefaultCommand(new ElevatorToBottom());

    // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=DEFAULT_COMMAND
}


Info: Internal Builder is used for build
arm-frc-linux-gnueabi-g++ -std=c++1y -I/Users/davidingraham/wpilib/cpp/current/include "-I\\$\\{workspace_loc:/2015RobotBuilder/src}" -O0 -g3 -Wall -c -fmessage-length=0 -o src/Subsystems/Elevator.o ../src/Subsystems/Elevator.cpp 
../src/Subsystems/Elevator.cpp: In member function 'virtual void Elevator::InitDefaultCommand()':
../src/Subsystems/Elevator.cpp:62:24: error: expected type-specifier before 'ElevatorToBottom'
  SetDefaultCommand(new ElevatorToBottom());

We were able to fix this by including the header file for the command we wished to set as the default:

#include "../Commands/ElevatorToBottom.h"

at the top of the “Subsystems/Elevator.cpp” source file.

It seems that RobotBuilder is not automatically including the the header file for the default command in the <subsystem>.cpp file. Is this a bug, or are we expected to add this manually?

In my(pretty limited) experience with the software, it can be pretty buggy.

I had the same problem. Had no problem with default command for one subsystem, but another I had to manually add the header file for another or it wouldn’t build.