Open manibenwa opened 6 years ago
were you able to solve this issue? I am having the same problem.
Can verify we're also having the same issue here. Any fixes? My exact error is slightly different:
debian@beaglebone:~/[redacted]/BBCLib/examples/leds$ gcc onboardleds.c -o leds
/usr/lib/gcc/arm-linux-gnueabihf/6/../../../arm-linux-gnueabihf/Scrt1.o: In function `_start':
(.text+0x44): undefined reference to `main'
/tmp/ccH15oHX.o: In function `onBoardLedsExample':
onboardleds.c:(.text+0x8b2): undefined reference to `debug'
collect2: error: ld returned 1 exit status
I don't believe it makes any difference, but the hardware being used is the SanCloud BeagleBone Enhanced, which is based on the Black with some modifications and extra sensors.
Update @manibenwa @danboatman, I think I've made some headway here.
I was trying to compile purely the onboardleds.c
file (which includes its associated header onboardleds.h
). That file does not have a main
method, resulting in the error that we get. Note that in pbr.sh
, the actual executable is BBCLib
living in the root directory and is compiled from examples/example.c
. That file has a main method, and includes the methods that actually do something from the example files that I (we?) were trying to compile (the ones like examples/leds/onboardleds.c
).
It seems like the example files here are not to be run on their own, but rather #include
d and used that way.
Hai ,
i downloaded BBCLib library from this github and iam trying to compile the program ,it gives me following error
/usr/lib/gcc/arm-linux-gnueabihf/4.9/../../../arm-linux-gnueabihf/crt1.o: In function
_start': (.text+0x28): undefined reference to
main' /tmp/ccJqpvUX.o: In functionuartExample': uart_example.c:(.text+0x12): undefined reference to
init_bbc_lib' uart_example.c:(.text+0x36): undefined reference touart_open' uart_example.c:(.text+0x80): undefined reference to
uart_send' uart_example.c:(.text+0xb2): undefined reference touart_read' uart_example.c:(.text+0xf8): undefined reference to
uart_close' collect2: error: ld returned 1 exit statuscan u please tell me is there any thing need to attache while compiling the program???