I’m trying to get some things that work in Linux (Ubuntu 16) set up to work under Windows 7, using Eclipse IDE and targetting the 3pi robot. My sample project to print to the 3pi’s screen and turn the motors compiles, builds to a hex and loads onto the robot. All great.
However, when I try to add functionality to read the calibrated sensors (I’m specifically using the function read_line_sensors_calibrated()
) , I get a linking error related to PololuQTRSensors.cpp. The build output is below:
make all
Building file: …/assign1_3pi.cpp
Invoking: AVR C++ Compiler
avr-g++ -Wall -Os -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -funsigned-char -funsigned-bitfields -fno-exceptions -mmcu=atmega328p -DF_CPU=2000000UL -MMD -MP -MF"assign1_3pi.d" -MT"assign1_3pi.o" -c -o “assign1_3pi.o” “…/assign1_3pi.cpp”
…/assign1_3pi.cpp: In function ‘void calibrateLineSensors()’:
…/assign1_3pi.cpp:64: warning: comparison between signed and unsigned integer expressions
…/assign1_3pi.cpp:81: warning: unused variable ‘position’
…/assign1_3pi.cpp: At global scope:
…/assign1_3pi.cpp:30: warning: ‘void displayGraph(const unsigned int*)’ defined but not used
Finished building: …/assign1_3pi.cppBuilding target: lab1.elf
Invoking: AVR C++ Linker
avr-g++ -Wl,-Map,lab1.map,–cref -mrelax -Wl,–gc-sections -L"C:\libpololu-avr" -mmcu=atmega328p -o “lab1.elf” ./assign1_3pi.o -lpololu_atmega328p
C:\libpololu-avr\libpololu_atmega328p.a(PololuQTRSensors.o): In functionPololuQTRSensors::~PololuQTRSensors()': /home/david/libpololu-avr/devices/atmega328p/../../src/PololuQTRSensors/../../src/PololuQTRSensors/PololuQTRSensors.cpp:780: undefined reference to
__muluhisi3’
make: *** [lab1.elf] Error 114:12:30 Build Failed. 2 errors, 3 warnings. (took 342ms)
I’ve installed Eclipse, WinAVR, Pololu AVR Development Bundle and used this page(https://www.instructables.com/id/How-to-get-started-with-Eclipse-and-AVR/) as a guide for setup.
Any suggestions on how to resolve this error?