Log in

View Full Version : WPILib.h not found


truffly
15-01-2014, 19:24
I recently installed WindRiver on my laptop (I am using Windows 7), and had a problem with g++. Figured that out, was able to build the project, but with errors -- when I go to include WPILib, I get an error saying

g++: unrecognized option `-MP'
C:/WindRiver/workspace/2014RobotCode/MyRobot.cpp:1: WPILib.h: No such file or directory
C:\WindRiver\utilities-1.0\x86-win32\bin\make.exe: *** [2014RobotCode/Debug/Objects/2014RobotCode/MyRobot.o] Error 1
Build Failed in Project '2014RobotCode' (Process Exit Value was 2): 2014-01-15 18:17:16 (Elapsed Time: 00:00)

I tried including WPILib.h through vxWorks, but then it returns a whole list of errors because it can't find a ton of files included in WPILib.h ... I have the workbench update installed, I installed the 2014 driver station, wind river update, and I'm stuck. Any ideas on a fix? A mentor suggested re-installing everything, but...hoping to avoid that.

William Kunkel
16-01-2014, 14:54
What are your build settings for the project? Right-click on the project in the file tree and go down to "Properties". Under "Build Properties" > "Paths", you should have these three include directories:

-I$(WIND_BASE)/target/h/coreip
-I$(WIND_BASE)/target/h/WPILib
-I$(WIND_BASE)/target/h


Under "Build Properties" > "Libraries" you'll need

$(WIND_BASE)/target/lib/WPILib.a


Make sure you have those settings in place.

BradAMiller
16-01-2014, 19:05
Did you create your project based on one of the sample robot projects? Those should have all the paths and project options set up to work. The steps for doing that are here:

http://wpilib.screenstepslive.com/s/3120/m/7913/l/79734-creating-a-robot-project

Try one of those and verify that it compiles correctly. Then add your code to that project.