Deploy to Robot fails to build - Phoenix library order

One of our students is getting a strange error trying to deploy to the robot. She can build fine, but when running the run as -> c++ deploy it then gets the following error.

D:\CTR\CTRE-Toolsuite\Phoenix-frc-lib\cpp\src\MotorControl/SensorCollection.cpp:239: undefined reference to `c_MotController_IsRevLimitSwitchClosed’
collect2: error: ld returned 1 exit status

When looking at the settings, we notice that the CTRE_Phoenix and CTRE_PhoenixCCI have flipped order and CTRElib. We’ve seen that it seems to be passing this as a parameter at the end of the deploy command, but unsure how to fix that :confused:

We’re using eclipse on linux.

We’ve done the update to beta toolchains.

Appreciate the help, new to robotics mentoring haven’t done c++ in 20 years, cobol programming isn’t helping me much at this point :slight_smile:

I’m also using the Phoenix library (We use TalonSRXs) but on Windows. I can give it a shot at troubleshooting if you’re willing to post code.

thanks for the quick reply, i’ll need to check with our lead mentor and the student also just left with her computer. if I can get her to send some stuff, i’ll let you know.

it does seem to be computer specific, another linux box we have builds and deploys fine.

The eclipse plugins automatically enumerate the libraries by filesystem inode (which is essentially random on each machine). When automatic library management is turned on, they are picked up randomly and added as -l directives to the linkage command.

You can disable that via Window > Preferences > WPILib Preferences and unchecking the relevant box. After that, you can specify the library order manually via Project Properties > C/C++ Build > Settings > Cross G++ Linker > Libraries.

We’ll be getting a fix into the plugins sometime this week for update 1.

We had this show up on some other computers, I’m pretty sure that we had a .cproject file with these floating in our Git Repo and that was getting pulled in. I think we’ve corrected the problem now…but not entirely sure since it was intermittent on several computers. Quite the newb at c++, so figured I’d post in case that helped one of you to clarify for sure the problem.

This should be fixed in the 2018.2.1 (and later) version of the plugins. If you’re using that version and still having issues, please let us know.

i can confirm that this fixed with 2018.2.2

we did have one person who was still having issues, but figured out that they had updated their wpilib folders with a paste (which did a merge), so they had a bunch of the old ctrlib folders in there and the build was still putting those back. Deleting these folders fixed that.