Compile errors with Mbed CLI

Home Forums mDot/xDot Compile errors with Mbed CLI

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #23265
    John Greene
    Participant

    I’m trying to compile the AUTO_OTA_EXAMPLE from the Dot-Examples program for mDot using the Mbed CLI. I imported dot-examples and added LibmDot-mbed5 and mbed-os-5.4.7. Trying various configurations, I always get errors with “[abi:cxx11]” and “ __CXX11”. Following is an example:

    C:\Users\jgree\Projects\Dot-Examples>mbed compile -m MTS_MDOT_F411RE -t GCC_ARM
    Building project Dot-Examples (MTS_MDOT_F411RE, GCC_ARM)
    Scan: .
    Scan: FEATURE_BLE
    Scan: FEATURE_COMMON_PAL
    Scan: FEATURE_LWIP
    Scan: FEATURE_UVISOR
    Scan: FEATURE_ETHERNET_HOST
    Scan: FEATURE_LOWPAN_BORDER_ROUTER
    Scan: FEATURE_LOWPAN_HOST
    Scan: FEATURE_LOWPAN_ROUTER
    Scan: FEATURE_NANOSTACK
    Scan: FEATURE_NANOSTACK_FULL
    Scan: FEATURE_THREAD_BORDER_ROUTER
    Scan: FEATURE_THREAD_END_DEVICE
    Scan: FEATURE_THREAD_ROUTER
    Scan: FEATURE_STORAGE
    Scan: mbed
    Scan: env
    Link: Dot-Examples
    ./BUILD/MTS_MDOT_F411RE/GCC_ARM/examples/src/auto_ota_example.o: In function 

    RadioEvent::MacEvent(LoRaMacEventFlags*, LoRaMacEventInfo*)’:
    auto_ota_example.cpp:(.text._ZN10RadioEvent8MacEventEP17LoRaMacEventFlagsP16LoRaMacEventInfo[_ZN10RadioEvent8MacEventEP17LoRaMacEventFlagsP16LoRaMacEventInfo]+0xe2): undefined reference to `mts::Text::bin2hexString[abi:cxx11](unsigned char const*, unsigned long, char const*, bool, bool)’
    ./BUILD/MTS_MDOT_F411RE/GCC_ARM/examples/src/auto_ota_example.o: In function `mDotEvent::PacketRx(unsigned char, unsigned char*, unsigned short, short, signed char, lora::DownlinkControl, unsigned char, unsigned char)’:
    auto_ota_example.cpp:(.text._ZN9mDotEvent8PacketRxEhPhtsaN4lora15DownlinkControlEhh[_ZN9mDotEvent8PacketRxEhPhtsaN4lora15DownlinkControlEhh]+0x62): undefined reference to `mts::Text::bin2hexString[abi:cxx11](unsigned char const*, unsigned long, char const*, bool, bool)’
    ./BUILD/MTS_MDOT_F411RE/GCC_ARM/examples/src/dot_util.o: In function `join_network()’:
    dot_util.cpp:(.text._Z12join_networkv+0x3e): undefined reference to `mDot::getReturnCodeString[abi:cxx11](long const&)’
    ./BUILD/MTS_MDOT_F411RE/GCC_ARM/examples/src/dot_util.o: In function `sleep_wake_rtc_or_interrupt(bool)’:
    dot_util.cpp:(.text._Z27sleep_wake_rtc_or_interruptb+0x5c): undefined reference to `mDot::pinName2Str[abi:cxx11](PinName)’
    ./BUILD/MTS_MDOT_F411RE/GCC_ARM/examples/src/dot_util.o: In function `send_data(std::vector<unsigned char, std::allocator<unsigned char> >)’:
    dot_util.cpp:(.text._Z9send_dataSt6vectorIhSaIhEE+0x42): undefined reference to `mDot::getReturnCodeString[abi:cxx11](long const&)’
    ./BUILD/MTS_MDOT_F411RE/GCC_ARM/examples/src/dot_util.o: In function `update_ota_config_name_phrase(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned char, unsigned char)’:
    dot_util.cpp:(.text._Z29update_ota_config_name_phraseNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_hh+0x18): undefined reference to `mDot::getNetworkName[abi:cxx11]()’
    dot_util.cpp:(.text._Z29update_ota_config_name_phraseNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_hh+0x20): undefined reference to `mDot::getNetworkPassphrase[abi:cxx11]()’
    dot_util.cpp:(.text._Z29update_ota_config_name_phraseNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_hh+0x5a): undefined reference to `mDot::setNetworkName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)’
    dot_util.cpp:(.text._Z29update_ota_config_name_phraseNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_hh+0x8e): undefined reference to `mDot::setNetworkPassphrase(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)’
    ./BUILD/MTS_MDOT_F411RE/GCC_ARM/examples/src/dot_util.o: In function `display_config()’:
    dot_util.cpp:(.text._Z14display_configv+0x2c): undefined reference to `mDot::getId[abi:cxx11]()’
    dot_util.cpp:(.text._Z14display_configv+0x58): undefined reference to `mts::Text::bin2hexString[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&, char const*, bool, bool)’
    dot_util.cpp:(.text._Z14display_configv+0x80): undefined reference to `mDot::FrequencyBandStr[abi:cxx11](unsigned char)’
    dot_util.cpp:(.text._Z14display_configv+0xa2): undefined reference to `mDot::FrequencyBandStr[abi:cxx11](unsigned char)’
    dot_util.cpp:(.text._Z14display_configv+0xfc): undefined reference to `mDot::getClass[abi:cxx11]()’
    dot_util.cpp:(.text._Z14display_configv+0x11e): undefined reference to `mDot::JoinModeStr[abi:cxx11](unsigned char)’
    dot_util.cpp:(.text._Z14display_configv+0x15e): undefined reference to `mts::Text::bin2hexString[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&, char const*, bool, bool)’
    dot_util.cpp:(.text._Z14display_configv+0x18e): undefined reference to `mts::Text::bin2hexString[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&, char const*, bool, bool)’
    dot_util.cpp:(.text._Z14display_configv+0x1be): undefined reference to `mts::Text::bin2hexString[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&, char const*, bool, bool)’
    dot_util.cpp:(.text._Z14display_configv+0x224): undefined reference to `mDot::DataRateStr[abi:cxx11](unsigned char)’
    dot_util.cpp:(.text._Z14display_configv+0x352): undefined reference to `mDot::getNetworkName[abi:cxx11]()’
    dot_util.cpp:(.text._Z14display_configv+0x36e): undefined reference to `mDot::getNetworkPassphrase[abi:cxx11]()’
    dot_util.cpp:(.text._Z14display_configv+0x39a): undefined reference to `mts::Text::bin2hexString[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&, char const*, bool, bool)’
    dot_util.cpp:(.text._Z14display_configv+0x3ca): undefined reference to `mts::Text::bin2hexString[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&, char const*, bool, bool)’
    collect2.exe: error: ld returned 1 exit status
    [ERROR] ./BUILD/MTS_MDOT_F411RE/GCC_ARM/examples/src/auto_ota_example.o: In function `RadioEvent::MacEvent(LoRaMacEventFlags*, LoRaMacEventInfo*)’:
    auto_ota_example.cpp:(.text._ZN10RadioEvent8MacEventEP17LoRaMacEventFlagsP16LoRaMacEventInfo[_ZN10RadioEvent8MacEventEP17LoRaMacEventFlagsP16LoRaMacEventInfo]+0xe2): undefined reference to `mts::Text::bin2hexString[abi:cxx11](unsigned char const*, unsigned long, char const*, bool, bool)’
    ./BUILD/MTS_MDOT_F411RE/GCC_ARM/examples/src/auto_ota_example.o: In function `mDotEvent::PacketRx(unsigned char, unsigned char*, unsigned short, short, signed char, lora::DownlinkControl, unsigned char, unsigned char)’:
    auto_ota_example.cpp:(.text._ZN9mDotEvent8PacketRxEhPhtsaN4lora15DownlinkControlEhh[_ZN9mDotEvent8PacketRxEhPhtsaN4lora15DownlinkControlEhh]+0x62): undefined reference to `mts::Text::bin2hexString[abi:cxx11](unsigned char const*, unsigned long, char const*, bool, bool)’
    ./BUILD/MTS_MDOT_F411RE/GCC_ARM/examples/src/dot_util.o: In function `join_network()’:
    dot_util.cpp:(.text._Z12join_networkv+0x3e): undefined reference to `mDot::getReturnCodeString[abi:cxx11](long const&)’
    ./BUILD/MTS_MDOT_F411RE/GCC_ARM/examples/src/dot_util.o: In function `sleep_wake_rtc_or_interrupt(bool)’:
    dot_util.cpp:(.text._Z27sleep_wake_rtc_or_interruptb+0x5c): undefined reference to `mDot::pinName2Str[abi:cxx11](PinName)’
    ./BUILD/MTS_MDOT_F411RE/GCC_ARM/examples/src/dot_util.o: In function `send_data(std::vector<unsigned char, std::allocator<unsigned char> >)’:
    dot_util.cpp:(.text._Z9send_dataSt6vectorIhSaIhEE+0x42): undefined reference to `mDot::getReturnCodeString[abi:cxx11](long const&)’
    ./BUILD/MTS_MDOT_F411RE/GCC_ARM/examples/src/dot_util.o: In function `update_ota_config_name_phrase(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, unsigned char, unsigned char)’:
    dot_util.cpp:(.text._Z29update_ota_config_name_phraseNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_hh+0x18): undefined reference to `mDot::getNetworkName[abi:cxx11]()’
    dot_util.cpp:(.text._Z29update_ota_config_name_phraseNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_hh+0x20): undefined reference to `mDot::getNetworkPassphrase[abi:cxx11]()’
    dot_util.cpp:(.text._Z29update_ota_config_name_phraseNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_hh+0x5a): undefined reference to `mDot::setNetworkName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)’
    dot_util.cpp:(.text._Z29update_ota_config_name_phraseNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES4_hh+0x8e): undefined reference to `mDot::setNetworkPassphrase(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)’
    ./BUILD/MTS_MDOT_F411RE/GCC_ARM/examples/src/dot_util.o: In function `display_config()’:
    dot_util.cpp:(.text._Z14display_configv+0x2c): undefined reference to `mDot::getId[abi:cxx11]()’
    dot_util.cpp:(.text._Z14display_configv+0x58): undefined reference to `mts::Text::bin2hexString[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&, char const*, bool, bool)’
    dot_util.cpp:(.text._Z14display_configv+0x80): undefined reference to `mDot::FrequencyBandStr[abi:cxx11](unsigned char)’
    dot_util.cpp:(.text._Z14display_configv+0xa2): undefined reference to `mDot::FrequencyBandStr[abi:cxx11](unsigned char)’
    dot_util.cpp:(.text._Z14display_configv+0xfc): undefined reference to `mDot::getClass[abi:cxx11]()’
    dot_util.cpp:(.text._Z14display_configv+0x11e): undefined reference to `mDot::JoinModeStr[abi:cxx11](unsigned char)’
    dot_util.cpp:(.text._Z14display_configv+0x15e): undefined reference to `mts::Text::bin2hexString[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&, char const*, bool, bool)’
    dot_util.cpp:(.text._Z14display_configv+0x18e): undefined reference to `mts::Text::bin2hexString[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&, char const*, bool, bool)’
    dot_util.cpp:(.text._Z14display_configv+0x1be): undefined reference to `mts::Text::bin2hexString[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&, char const*, bool, bool)’
    dot_util.cpp:(.text._Z14display_configv+0x224): undefined reference to `mDot::DataRateStr[abi:cxx11](unsigned char)’
    dot_util.cpp:(.text._Z14display_configv+0x352): undefined reference to `mDot::getNetworkName[abi:cxx11]()’
    dot_util.cpp:(.text._Z14display_configv+0x36e): undefined reference to `mDot::getNetworkPassphrase[abi:cxx11]()’
    dot_util.cpp:(.text._Z14display_configv+0x39a): undefined reference to `mts::Text::bin2hexString[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&, char const*, bool, bool)’
    dot_util.cpp:(.text._Z14display_configv+0x3ca): undefined reference to `mts::Text::bin2hexString[abi:cxx11](std::vector<unsigned char, std::allocator<unsigned char> > const&, char const*, bool, bool)’
    collect2.exe: error: ld returned 1 exit status

    [mbed] ERROR: “C:\Python27\python.exe” returned error code 1.
    [mbed] ERROR: Command “C:\Python27\python.exe -u C:\Users\jgree\Projects\Dot-Examples\mbed-os\tools\make.py -t GCC_ARM -m MTS_MDOT_F411RE –source . –build .\BUILD\MTS_MDOT_F411RE\GCC_ARM” in “C:\Users\jgree\Projects\Dot-Examples”

    C:\Users\jgree\Projects\Dot-Examples>
    `
    I have tried using the -D_GLIBCXX_USE_CXX11_ABI=0 macro and using older versions of the GCC toolchain although nothing resolves the issue.

    #23271
    Jason Reiss
    Keymaster

    What gcc arm version are you using?
    Have you tried gcc-arm-none-eabi-6-2017-q2-update?

    #23273
    Matt Brown
    Participant

    I’ve also tried to build Dot-Examples using GCC ARM, although I’m building OTA_EXAMPLE rather than AUTO_OTA_EXAMPLE.

    The first undefined reference I see is mDot::getReturnCodeString.

    Initially I was using ‘6 2017-q2-update’, which was installed by Mbed CLI. But, I’ve also tried ‘7 2017-q4-major’.

    I changed to the online compiler but would much rather be using the CLI and ARM GCC.

    HTH,
    Matt

    #23274
    Ryan Klaassen
    Blocked

    Have you tried GCC 4.9? If using mbed-5.4.7 GCC 4.9 is recommended.

    #23278
    Matt Brown
    Participant

    I have now.

    I downloaded Arm GCC 4.9 from launchpad, it took me a while to find it. I went for 2015 Q3 update.

    https://launchpad.net/gcc-arm-embedded/4.9

    Now I can link.

    Thanks,
    Matt

    #23283
    John Greene
    Participant

    I used GCC-4.9 2015q3 because that is what was apparently used to compile mbed-0S-5.4.7 which, in turn, was used for mdot-library rev 3.0.0. I also tried with GCC-6 2017-q2-update the resultant log for which I provided upthread.

    I just switched back to GCC-4.9 and ran it again before clicking “Submit” on this thread and it worked. Who knows, most likely user error. Thanks for your feedback/help.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.