본문 바로가기

개발자/Raspberry Pi

KT 제공 IoT Makers 에 연동시 컴파일 오류

반응형





설명서에 나온대로 

$make  clean 하고


$make  했더니 아래처럼 에러가


pi@raspberrypi:~/ktiot/test $ make clean

rm -rf main.o

pi@raspberrypi:~/ktiot/test $ make

gcc -W -O0 -g -I../include -c main.c -o main.o

gcc -o tt main.o   ../lib/libiotmakers.a -lpthread

main.o: In function `mycb_strdata_handler':

/home/pi/ktiot/test/main.c:47: undefined reference to `pinMode'

/home/pi/ktiot/test/main.c:53: undefined reference to `digitalWrite'

/home/pi/ktiot/test/main.c:58: undefined reference to `digitalWrite'

main.o: In function `main':

/home/pi/ktiot/test/main.c:90: undefined reference to `wiringPiSetup'

/home/pi/ktiot/test/main.c:103: undefined reference to `pinMode'

/home/pi/ktiot/test/main.c:104: undefined reference to `digitalWrite'

/home/pi/ktiot/test/main.c:105: undefined reference to `delay'

/home/pi/ktiot/test/main.c:106: undefined reference to `digitalWrite'

/home/pi/ktiot/test/main.c:107: undefined reference to `delayMicroseconds'

/home/pi/ktiot/test/main.c:108: undefined reference to `pinMode'

/home/pi/ktiot/test/main.c:117: undefined reference to `delayMicroseconds'

/home/pi/ktiot/test/main.c:114: undefined reference to `digitalRead'

/home/pi/ktiot/test/main.c:120: undefined reference to `digitalRead'

/home/pi/ktiot/test/main.c:144: undefined reference to `delay'

/home/pi/ktiot/test/main.c:147: undefined reference to `pinMode'

/home/pi/ktiot/test/main.c:148: undefined reference to `digitalRead'

collect2: error: ld returned 1 exit status

Makefile:50: recipe for target 'tt' failed

make: *** [tt] Error 1




해결방법


컴파일 할때 pi@raspberrypi:~/ktiot/test $ gcc -o tt main.o   ../lib/libiotmakers.a -lpthread -lwiringPi


처럼 뒤에 -lwiringPi 빠뜨리면 암됨.





반응형

더욱 좋은 정보를 제공하겠습니다.~ ^^