Forum >Replies by tstephens
userhead tstephens
Replies (3)
  • You Reply:

    OKAY found the problem - for anyone having a similar issue - it's in the version 10.x of gcc. I downgraded to gcc-8 and it compiles correctly.Tim

  • You Reply:

    Okay… so it seems to be something to do with the version of raspbian (bullseye) or my particular install. It comples correctly on another Pi I have here running buster.

  • You Reply:

    Edit: here's a better formatted error list below.

     

    Also… I can remove most of the undefined references (as if it's can't link a library?!) by running 

    gcc -Wall -o Wind_Speed *.c -lwiringPi 

     

    and now only the first error remains:

    /usr/bin/ld: /tmp/cc0RGEZU.o:(.bss+0x0): multiple definition of `fd'; /tmp/ccVhZ6rU.o:(.bss+0x0): first defined here

     

    I can't code in c++ so can't figure out why the function fd would be referencing twice?!

     

    Tim

     

     

    Reformatted error:

    /usr/bin/ld: /tmp/ccuGudLt.o:(.bss+0x0): multiple definition of `fd'; /tmp/ccb3g0Xr.o:(.bss+0x0): first defined here /usr/bin/ld: /tmp/ccb3g0Xr.o: in function `main':main.c:(.text+0x24): undefined reference to `delay' /usr/bin/ld: main.c:(.text+0x88): undefined reference to `delay'/usr/bin/ld: /tmp/ccuGudLt.o: in function `ModifyAddress': RS485_Wind_Speed_Transmitter.c:(.text+0x158): undefined reference to `millis' /usr/bin/ld: RS485_Wind_Speed_Transmitter.c:(.text+0x1b0): undefined reference to `millis'          /usr/bin/ld: RS485_Wind_Speed_Transmitter.c:(.text+0x1c8): undefined reference to `millis'          /usr/bin/ld: RS485_Wind_Speed_Transmitter.c:(.text+0x1f8): undefined reference to `millis'          /usr/bin/ld: RS485_Wind_Speed_Transmitter.c:(.text+0x210): undefined reference to `serialDataAvail' /usr/bin/ld: RS485_Wind_Speed_Transmitter.c:(.text+0x224): undefined reference to `delay'           /usr/bin/ld: /tmp/ccuGudLt.o: in function `Init':                                                   RS485_Wind_Speed_Transmitter.c:(.text+0x3b8): undefined reference to `serialOpen'                   /usr/bin/ld: /tmp/ccuGudLt.o: in function `readWindSpeed':                                          RS485_Wind_Speed_Transmitter.c:(.text+0x478): undefined reference to `millis'                       /usr/bin/ld: RS485_Wind_Speed_Transmitter.c:(.text+0x4c8): undefined reference to `millis'          /usr/bin/ld: RS485_Wind_Speed_Transmitter.c:(.text+0x4ec): undefined reference to `millis'          /usr/bin/ld: RS485_Wind_Speed_Transmitter.c:(.text+0x51c): undefined reference to `millis'          /usr/bin/ld: RS485_Wind_Speed_Transmitter.c:(.text+0x534): undefined reference to `serialDataAvail' /usr/bin/ld: RS485_Wind_Speed_Transmitter.c:(.text+0x548): undefined reference to `delay'