When I try to build a command based robot project with no code changed or added I get this.(I simply made the project, rebuilt indexes and hit build)
I tried the getting started project and that worked fine…
00:27:42 **** Build of configuration Debug for project RobotProject ****
make all
Building file: …/src/Subsystems/ExampleSubsystem.cpp
Invoking: Cross G++ Compiler
g++ -I"C:\Users\mario/wpilib/cpp/current/include" -I"C:\Users\mario\eclipse-workspace\RobotProject\src" -I"C:\Users\mario/wpilib/user/cpp/include" -O0 -g3 -Wall -c -fmessage-length=0 -pthread -MMD -MP -MF"src/Subsystems/ExampleSubsystem.d" -MT"src/Subsystems/ExampleSubsystem.o" -o “src/Subsystems/ExampleSubsystem.o” “…/src/Subsystems/ExampleSubsystem.cpp”
In file included from C:\Users\mario/wpilib/cpp/current/include/ErrorBase.h:12:0,
from C:\Users\mario/wpilib/cpp/current/include/Commands/Subsystem.h:15,
from …/src/Subsystems/ExampleSubsystem.h:4,
from …/src/Subsystems/ExampleSubsystem.cpp:1:
C:\Users\mario/wpilib/cpp/current/include/support/mutex.h:20:22: error: ‘mutex’ in namespace ‘std’ does not name a type
using mutex = ::std::mutex;
^~~~~
C:\Users\mario/wpilib/cpp/current/include/support/mutex.h:21:32: error: ‘recursive_mutex’ in namespace ‘std’ does not name a type
using recursive_mutex = ::std::recursive_mutex;
^~~~~~~~~~~~~~~
In file included from C:\Users\mario/wpilib/cpp/current/include/Commands/Subsystem.h:15:0,
from …/src/Subsystems/ExampleSubsystem.h:4,
from …/src/Subsystems/ExampleSubsystem.cpp:1:
C:\Users\mario/wpilib/cpp/current/include/ErrorBase.h:120:15: error: ‘mutex’ in namespace ‘wpi’ does not name a type
static wpi::mutex _globalErrorMutex;
^~~~~
In file included from C:\Users\mario/wpilib/cpp/current/include/Commands/Subsystem.h:17:0,
from …/src/Subsystems/ExampleSubsystem.h:4,
from …/src/Subsystems/ExampleSubsystem.cpp:1:
C:\Users\mario/wpilib/cpp/current/include/SmartDashboard/SendableBase.h:39:16: error: ‘mutex’ in namespace ‘wpi’ does not name a type
mutable wpi::mutex m_mutex;
^~~~~
make: *** [src/Subsystems/ExampleSubsystem.o] Error 1
00:27:43 Build Finished (took 1s.636ms)
How can I fix it(I included everything just in case)
It looks likes somehow its using make and the desktop compiler to build, which would explain these errors. How are you running the build? When you click build, eclipse should give a popup window with a few options. Make sure to select the one that say WPILib C++ Deploy. IIRC, its the 2nd option.
Note that right clicking on the project and choosing Build Project could cause that behavior on Linux platforms. I haven’t tested that in the past. But a Run As with the WPILib C++ Deploy will properly build the project.
I’m trying that without the RoboRio connected and get that “echo.exe has stopped working” I click close program(cuz debug did nothing) then it sais “the build failed are you sure you want to continue deploy” I say no and get this error message
14:03:03 **** Incremental Build of configuration Debug for project RobotProject ****
make all
0 [main] us 0 open_stackdumpfile: Dumping stack trace to us.stackdump
make: *** [src/Subsystems/ExampleSubsystem.o] Error 5