This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Failing to compile Thread example after updating OpenThread library

Hi all, I tried to modify the OpenThread's source codes(Just modify an API) and then built them.

  • Run the build_gcc_libs.bat script to build all of the libraries. That's OK.
  • After the libraries are built, use the provided script (<InstallFolder>/external/openthread/project/import_gcc_libs.bat) to copy the compiled libraries to the output folder.
  • Copy the /external/project/openthread/include folder into the /external/openthread folder.

Everything was fine until I tried to recompile the examples with the latest libraries. I don't know what is wrong, please find here below the error log. Such as:

openthread/src/core/thread/mle.cpp:403: undefined reference to `otPlatSettingsSet'

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
E:\Git\w-repo\nRF5_SDK_for_Thread_v0.11.0_84a130f\examples\thread\experimental\cli\uart\pca10056\blank\armgcc>make
Compiling file: thread_utils.c
Linking target: _build/nrf52840_xxaa.out
../../../../../../../../external/openthread/lib/gcc/libopenthread-cli-ftd.a(cli_uart.cpp.o):(.rodata._ZTIN2ot3Cli6ServerE[_ZTIN2ot3Cli6ServerE]+0x0): undefined reference to `vtable for __cxxabiv1::__class_type_info'
../../../../../../../../external/openthread/lib/gcc/libopenthread-cli-ftd.a(cli_uart.cpp.o):(.rodata._ZTIN2ot3Cli4UartE+0x0): undefined reference to `vtable for __cxxabiv1::__si_class_type_info'
../../../../../../../../external/openthread/lib/gcc/libopenthread-ftd.a(dataset_local.cpp.o): In function `ot::MeshCoP::DatasetLocal::Clear()':
E:\Git\w-repo\nRF5_SDK_for_Thread_v0.11.0_84a130f\external\openthread\project\lib\openthread\ftd\armgcc/../../../../openthread/src/core/meshcop/dataset_local.cpp:63: undefined reference to `otPlatSettingsDelete'
../../../../../../../../external/openthread/lib/gcc/libopenthread-ftd.a(dataset_local.cpp.o): In function `ot::MeshCoP::DatasetLocal::IsPresent() const':
E:\Git\w-repo\nRF5_SDK_for_Thread_v0.11.0_84a130f\external\openthread\project\lib\openthread\ftd\armgcc/../../../../openthread/src/core/meshcop/dataset_local.cpp:68: undefined reference to `otPlatSettingsGet'
../../../../../../../../external/openthread/lib/gcc/libopenthread-ftd.a(dataset_local.cpp.o): In function `ot::MeshCoP::DatasetLocal::Get(ot::MeshCoP::Dataset&)':
E:\Git\w-repo\nRF5_SDK_for_Thread_v0.11.0_84a130f\external\openthread\project\lib\openthread\ftd\armgcc/../../../../openthread/src/core/meshcop/dataset_local.cpp:78: undefined reference to `otPlatSettingsGet'
../../../../../../../../external/openthread/lib/gcc/libopenthread-ftd.a(dataset_local.cpp.o): In function `ot::MeshCoP::DatasetLocal::Get(otOperationalDataset&) const':
E:\Git\w-repo\nRF5_SDK_for_Thread_v0.11.0_84a130f\external\openthread\project\lib\openthread\ftd\armgcc/../../../../openthread/src/core/meshcop/dataset_local.cpp:111: undefined reference to `otPlatSettingsGet'
../../../../../../../../external/openthread/lib/gcc/libopenthread-ftd.a(dataset_local.cpp.o): In function `ot::MeshCoP::DatasetLocal::Set(otOperationalDataset const&)':
E:\Git\w-repo\nRF5_SDK_for_Thread_v0.11.0_84a130f\external\openthread\project\lib\openthread\ftd\armgcc/../../../../openthread/src/core/meshcop/dataset_local.cpp:367: undefined reference to `otPlatSettingsDelete'
E:\Git\w-repo\nRF5_SDK_for_Thread_v0.11.0_84a130f\external\openthread\project\lib\openthread\ftd\armgcc/../../../../openthread/src/core/meshcop/dataset_local.cpp:372: undefined reference to `otPlatSettingsSet'
../../../../../../../../external/openthread/lib/gcc/libopenthread-ftd.a(dataset_local.cpp.o): In function `ot::MeshCoP::DatasetLocal::Set(ot::MeshCoP::Dataset const&)':
E:\Git\w-repo\nRF5_SDK_for_Thread_v0.11.0_84a130f\external\openthread\project\lib\openthread\ftd\armgcc/../../../../openthread/src/core/meshcop/dataset_local.cpp:395: undefined reference to `otPlatSettingsDelete'
E:\Git\w-repo\nRF5_SDK_for_Thread_v0.11.0_84a130f\external\openthread\project\lib\openthread\ftd\armgcc/../../../../openthread/src/core/meshcop/dataset_local.cpp:400: undefined reference to `otPlatSettingsSet'
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Thank you!