Closed icecube45 closed 7 years ago
Are you using the 2017 Plugins?
Indeed I am
Try putting the pathfinder libraries in ~/wpilib/user/java
, the same place the SRX libraries are stored (if you installed them).
I'm using cpp, but putting the includes and library under the cpp section of the wpilib folder (where the third party libraries are) results in no change.
I've found the issue. It turns out WPILib doesn't link .a
files, only .so
files. Hold tight and I'll build a .so
version for you to include
Head to the releases and download the C++ fix, export this into your ~/wpilib/user/cpp
folder and it should work.
Great! I'll try it out tomorrow and report back
Did you get this working? We are having problems linking the .so following the instructions in the wiki.
Working with @Sloth7 on this. The .so file in the most recent release is only 27KB. Is this correct? It seems small.
@Kython89 Yes, this is correct. Pathfinder doesn't have any dependencies so the binary is fairly small. 27KB seems nominal
@Sloth7 don't use the Wiki instructions for this. Put the .so
library under ~/wpilib/user/cpp/lib
and the header files under ~/wpilib/user/cpp/include
My team has been working on getting this integrated to a 2017 C++ Command Base project and have been running into the same issue.
I believe the issue is due to name mangling between C and C++.
The errors were resolved by adding extern "C"
around all of the includes in pathfinder.h
. (gist)
A clean of the project after adding extern
allows the project to build successfully.
I have pulled in both the most recent release with the .so and the previous release with the .a binaries at different times. Both seem to work just fine as far as compiling goes. CTRE, SF2, etc. all seem to have .a binaries and can be pulled in just fine.
Thoughts?
@CaptainGeneric Pathfinder is designed to be a C library, that can be imported into C++ projects. Does it build successfully if, in your robot program, you use
extern "C" #include "pathfinder.h"
instead of
#include "pathfinder.h"
Yeah, I wasn't a fan of modifying the header file to get the project to compile. That's definitely not the resolution.
I did try your suggestion (and a few other things) and didn't have any luck by changing the way the robot project includes the library. I'll try to pick this back up tomorrow to see if I can figure out anything else.
Let me know if you have any other ideas. I would be happy to give them a shot.
Hmm, if adding extern "C"
seems to fix it in the pathfinder.h file, I'll put in an ifdef __cplusplus
for it. Hold tight, I'll work on something soon
There's now a fix up that allows Pathfinder to be included with WPILib C++ projects. Get the release here and extract it to ~/wpilib/user/cpp
. This should close this issue, if there's anything else related to this issue please reopen it or create a new one
@JacisNonsense The latest release you provided works great and we can now link.
Hi! This library looks exactly like what I've been looking for, my only issue is that it doesn't appear to link in eclipse neon.
My project outputs the errors of
I'm pretty sure I'm linking it correctly, the lib folder is in my search paths for libraries, and the pathfinder library is on the top of my list.
Any help would be greatly appreciated.