WPIlib not being included in new projects

I just finished setting up Eclipse with the FRC C++ plugin on my Mac and for some reason, WPIlib is not being included in new projects. Also, the “Add Include” option is greyed out. I can open a new sample robot project, but it is filled with errors on almost every line. Does anyone know how to fix this? Thanks!

When you create projects through File > New > Wpilib > robot C++ project it should be adding the includes automatically. Check on the “paths and symbols” section if your project build settings, there should be a wpilib location listed under include paths. If there isn’t, try setting up a new project with File > New > Wpilib > robot C++ project.

If the include path is listed but you still have errors, make sure you have correctly used the #include directive in your code. Also, you can try rebuilding your C++ index by right clicking your project > index > rebuild.

All the projects I create through WPILib don’t have the includes, but they all have:

#include "WPILib.h"

at the top of the Robot.cpp. Also, rebuilding the index doesn’t seem to fix it.

In Paths and Symbols > Includes > GNU C++, I have “{WPILIB}/cpp/current/include" and "/{ProjName}/src”. The libraries tab just as an entry called “wpi” and the Library Paths tab just has “${WPILIB}/cpp/current/lib” again. Are my settings wrong here or could something else be the problem?

Thanks for all the help!

Just update my Eclipse to Mars, reinstalled all the plugins, and reinstalled the toolchain. The FRC libraries are now being included (yay!) but there are still some other issues. It’s giving me some basic C++ errors like “fatal error: iostream: no such file or directory” and not recognizing anything from the standard library. I have rebuild the index and everything from Paths and Symbols looks the same as before. Any ideas? Thanks!

If you right click the project, click Properties, expand C/C++ Build, hit Settings, then on the right side Tool Settings -> Cross Settings, there will be a Path element. Make sure that it’s pointing at the correct location for your machine: if it’s not, update it to point at the bin directory of the installed toolchains.

It’s pointing to “/usr/local/bin” which should be the correct folder, but I still tried “/usr/bin” and “/usr/local/arm-frc-linux-gnueabi/bin” just in case, and they both didn’t work. Is there anything else it could be?

It should be the path that you see when you run a

which arm-frc-linux-gnueabi-g++

minus the actual executable at the end.

It returned “/usr/local/bin/arm-frc-linux-gnueabi-g++”, and I already had it in “/usr/local/bin” so I didn’t end up changing anything. Here is what the console returns when I try to compile the starting code:

18:19:40 **** Incremental Build of configuration Debug for project 1452-Omnicats-2016 ****
Info: Internal Builder is used for build
arm-frc-linux-gnueabi-g++ -std=c++1y -I/Users/****/wpilib/cpp/current/include "-I/Users/****/FRC 2016/1452-Omnicats-2016/src" -O0 -g3 -Wall -c -fmessage-length=0 -o src/Robot.o ../src/Robot.cpp 
In file included from ../src/Robot.cpp:1:0:
/Users/****/wpilib/cpp/current/include/WPILib.h:13:20: fatal error: iostream: No such file or directory
 #include <iostream>

Thanks!

Same problem. Did anyone ever figure this out?

I never figured it out, I just switched to bootcamp and it works there.