fatal error: #include "WPILib.h"

wrote just a template out for a robot we're programming at school. I pressed build on code blocks and got the error "WPILib.h" I moved the program to eclipse to see if the problem would be resolved, still same error. I'm thinking it's probably the complier, Is there any complier that I can use to support this?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "WPILib.h"

class RobotDemo : public SimpleRobot
{
public:
    RobotDemo(void)
    {

        //put initialization code here
    }
    void Autonomous(void)
    {
        //put autonomous code here
    }
    void OperatorControl(void)
    {
        //put teleop code here
    }
};
START ROBOT CLASS(RobotDemo);
The header file is not a standard header file. Where did you get it? Did you get it?

This is not a compiler problem. This is your compiler looking for the file named WPILib.h and not finding it.
Last edited on
Did you specify the right include path for WPILib.h? You should specify this at Project->Build Options->Search Directories->Compiler. If you don't specify where to look, the compiler won't find it.
I downloaded the file from some site. I tried to specify the path but i still get the same error
closed account (E0p9LyTq)
eloy1073 wrote:
I downloaded the file from some site. I tried to specify the path but i still get the same error

Put/copy the header into the same folder where your other source files are, so your #include and you don't need to worry about pathing.
finally found my problem. Whenever I was supposed to start a program I was supposed to hit file, new, project, then c++ Robot. I was making a Console Application thinking it would work the same.
Topic archived. No new replies allowed.