I understand that the error is caused by having the //comment on the second line of the program, as #pragma config() lines have to be the first line(s) of the program. What is the reason for that first error? I can't find anything on the documentation listing a reason why #pragma config() has to be the first lines of the source file, just that it has to be.ĮDIT: To clarify. When I run this simple program, I get the following compilation errors: **Error**:'#pragma config(.)' must be first lines of source file NxtDisplayTextLine(1,'%i',SensorValue(touch2)) NxtDisplayTextLine(0,'%i',SensorValue(touch))
#pragma config(Sensor, S2, touch2, SensorTouch) #pragma config(Sensor, S1, touch, SensorTouch) A strange quirk in robotC that I've noticed is that, for some reason, #pragma config preprocessor directives only work when they are the first lines of the program. I'm a tutor for an undergrad class in robotics, and we use robotC (for NXT robotics, version 4.50) as the platform of choice.