I've been trying to build indilib on a phidgets sbc, based on an arm9 cpu design instead of arm6 like raspberry pi boards.
For some reason it keeps failing to complete compiling with this error:
[96%] Building CXX object libs/indibase/alignment/CMakeFiles/indi_skywatcherAPIMount.dir/__/__/__/drivers/telescope/skywatcherAPI.o
Linking CXX executable indi_skywatcherAPIMount
CMakeFiles/indi_skywatcherAPIMount.dir/__/__/__/drivers/telescope/skywatcherAPI.o: In function `SkywatcherAPI::Slew(SkywatcherAPI::AXISID, double)':
/root/Projects/libindi/drivers/telescope/skywatcherAPI.cpp:639: undefined reference to `SkywatcherAPI::MAX_SPEED'
collect2: ld returned 1 exit status
make[2]: *** [libs/indibase/alignment/indi_skywatcherAPIMount] Error 1
make[1]: *** [libs/indibase/alignment/CMakeFiles/indi_skywatcherAPIMount.dir/all] Error 2
make: *** [all] Error 2
I've placed a more complete log on pastebin: pastebin.com/vLb0RT6F
In case the url gets mashed, find entry vLb0RT6F on pastebin.
Can anyone tell me what's going on here? I lack the skills to figure out how to disable the skywatscherAPI stuff from the build, since i don't need it anyway. A few attempts failed and building indilib from source takes about an hour, so it's a bit cumbersome to keep prodding at it like i am trying now.
Hi,
Looks like I accidently left fell foul of the one definition rule (ODR) on this version of the GNU compiler. I have fixed this in trunk. However I have not got an arm9 platform to test on.
The declarations in SkywatcherAPI.h should be:
static const double SIDEREALRATE; // Radians per second
static const double MAX_SPEED; // Radians per second
static const double LOW_SPEED_MARGIN; // Radians per second
and the definitions in SkywatcherAPI.cpp should be
// One definition rule (ODR) constants
const double SkywatcherAPI::SIDEREALRATE = (2 * M_PI / 86164.09065); // Radians per second
const double SkywatcherAPI::LOW_SPEED_MARGIN = 128.0 * SIDEREALRATE;
const double SkywatcherAPI::MAX_SPEED = 500.0; // Radians per second
Can you try this out and let me know if it fixes from then problem. This is a bug in gcc as the compiler should error it and not just fail to define the symbol.
Thanks for the quick response, I've tried to implement your suggestions, in SkywatcherAPI.h i commented out the original declarations and added the suggested ones, in the .cpp file I added your lines above the "// Constructor" line. I'm hoping i did that right
Waiting for the build to finish, expect an update in about an hour.