Arduino IDE compile error "...undefined reference to `ros::normalizeSecNSec(unsigned long&..."
When I compile the "Hello World" example in the Arduino IDE I get this message:
HelloWorld.cpp.o: In function global constructors keyed to nh':
HelloWorld.cpp:31: undefined reference to
ros::normalizeSecNSec(unsigned long&, unsigned long&)'
collect2: ld returned 1 exit status
I arrived at this point after painstakingly editing the code of every file in the relevant sequence so that every #include "(some_file_name)" reference contained the full directory address to fix "No such file or directory" error messages. So:
"ros/msg.h"
became
"/home/ryan/sketchbook/libraries/ros/msg.h"
And it seemed to be working (at least it stopped throwing up those error messages) but I can't figure this error out. I'm stuck. Any help would be greatly appreciated.
Thanks for the input, Cody. I've mirrored the formatting as it is in the files and it seems to have worked. Those errors looked a bit like this"
HelloWorld.cpp:7:29: fatal error: std_msgs/String.h: No such file or directory compilation terminated.
This one is a bit different as it refers to a line of code directly in the "Hello World".pde file. Following the same tactic as before I modified it from:
include <std_msgs strings.h="">
to
include </home>
When I do this the compiler posts the error message I listed right at the top of my post. I don't know if this means I fixed that problem and am on to the next, or if the modification caused this error. I'm wondering if the IDE can't locate everything in my sketchbook for some reason. I assume I messed up something on the setup but I had no errors there that I could tell and the IDE sees the ros example files just fine, they're listed in its menus. Either way I'm still stuck.
Can you post all of the errors and warnings you get? I expect if the change in
#include "ros/msg.h"
changes things, we'll see some other items. Also, if you want code to format properly, wrap it in backticks or indent it with 4 spaces.Thanks, Cody. I've updated my post. The forum's displaying the code lines all screwy and I can't change it. No idea why. They should look like this. #include <std_msgs strings.h> and #include </home/ryan/sketchbook/libraries/std_msgs/Strings.h>
Have there been any updates on the potential root cause? I've tried a bunch of solutions but nothing seems to work.