WiringPi / WiringPi-Perl

Perl wrapped version of Gordon's Arduino-like WiringPi for the Raspberry Pi
13 stars 11 forks source link

perl: symbol lookup error: wiringpi.so: undefined symbol: softPwmStop #6

Open karstengit opened 9 years ago

karstengit commented 9 years ago

The compilation works and i can initialize the module. When the first pinMode command is called it crashes with an error.

perl -e 'use wiringpi; print wiringpi::wiringPiSetup()."\n";wiringpi::pinMode(1, 0);' perl: symbol lookup error: /usr/lib/perl/5.14/wiringpi.so: undefined symbol: softPwmStop

karstengit commented 9 years ago

I could solve the problem. You need to compile and link additional files to the result.

gcc -fpic -c -Dbool=char -I/usr/lib/perl/5.14.2/CORE wiringpi_wrap.c WiringPi/wiringPi/wiringPi.c WiringPi/wiringPi/softPwm.c WiringPi/wiringPi/softTone.c -D_GNU_SOURCE

gcc -shared wiringPi.o softPwm.o softTone.o wiringpi_wrap.o -o wiringpi.so

I hope gordon will add the corrected version now to his wiringpi project.

Gadgetoid commented 8 years ago

I've added this fix into the build.sh script, pending it being remixed into a proper makefile.