-
Notifications
You must be signed in to change notification settings - Fork 739
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build issues with mbed-os5.x over mbed-cli tool chain #1177
Comments
Hi @surajdagar are you using the latest version of the sdk? If so can you make sure the submodules are updated using the following command from the top level of the sdk. |
Hi @danewalton Yes, I am using the latest version of the SDK. Looks like my submodules are up to date too. |
are you building from the command line? are you able to post the full command? |
Yes, I am building with command line - mbed compile -t GCC_ARM -m nRF52840_DK |
The error leads me to believe that an include path isn't being passed to the build command? If you are on the latest sdk and submodules are updated that define should be here. The path from a cloned repo would be |
Hi @danewalton yes, I have "macro_utils.h" available on this path. You can reproduce it by downloading blinky from https://github.com/ARMmbed/mbed-os-example-blinky. Add azure c sdk into it. And compile it through mbed cli. |
Are you trying to include the azure c sdk directly via a the github url or via the mbed repositories here. I don't believe the sdk will compile correctly if you include the whole repo from github as the includes won't be resolved. It doesn't look like mbed cli allows you to specify an include directory option. |
I tried both ways to add from the mbed page using command mbed add. I use git clone to clone the whole SDK and in my project and add the required header files. |
Currently the only way we support is to include the repo's from the the arm website repos. Otherwise you will have to extract the pieces that you need from the github repo and put them in a flat directory structure in your mbed project. You will have to make the includes flat as well which means if a file is included in a |
Hey, I downloaded the arm website repos and try to build it. I am getting below errors- which looks related to the mbed-cli path. mbed-cli don't have any options to set path order. Can you please give it a try for nRF52840_DK target or share any link if it's being done before? |
Are you able to post the exact steps you followed to arrive at that result. So which |
Please find the steps below:
Use mbed CLI to build the same. |
So I believe I know what the problem is here. There is a TLDR at the bottom for a possible solution. It seems that the mbed cli does not allow for an include path to be passed and instead it does something that might seem at first useful to an end user but difficult if you wish to modify. It adds all directories in your current project to the include path. In our code, we have a file called In this case, whats happening is the standard TLDR: Pushing an update to the mbed would take some time so I'm hoping I can help unblock you. If you do a find and replace in the entire project looking for |
Thanks @danewalton , It works. |
@danewalton, @surajdagar, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey |
@danewalton Since we are working here Azure SDK compiled successfully but won't do anything after that. I have raised an issue for that Please have a look. @ #1222 |
@ #1222 closed and linked to this issue |
closing this one and looking into #1222 |
For anyone else needing to rename
|
All the examples build except for: 24_iot_websocket 34_iot_cloud_ms_azure 35_iot_cloud_tencent 24 and 35 have the same problem, namely include conflicts between the eabi toolchain implementation of pthreads and rt's implementation. 34 has a problem with include paths. The azure source code contains a file called 'strings.h' This conflicts with the standard C library, which has a header of the same name. Generally things are ok, because the azure strings.h is included by the azure source via a path, namely #include "azure_c_shared_utility/strings.h" But the macro_utils.h header happens to include <string.h>, which then includes <strings.h> but instead of the standard library version it resolves to the azure version. A hack-around was proposed here: Azure/azure-iot-sdk-c#1177 (comment) Basically do an exhaustive name change for azure's strings.h to az_strings.h This touches a lot of files in the azure source tree. I might try this in a subsequent commit...
Hey,
I am trying to build it with mbed-os 5, I am using mbed-cli to build this. I am getting below errors.
Compile [ 66.1%]: agenttime_mbed.c
[Error] strings.h@21,1: unknown type name 'MU_IF'
[Error] strings.h@22,1: unknown type name 'MU_IF'
[Error] strings.h@23,1: unknown type name 'MU_IF'
[Error] strings.h@24,1: unknown type name 'MU_IF'
[Error] strings.h@25,1: unknown type name 'MU_IF'
[Error] strings.h@26,1: unknown type name 'MU_IF'
[Error] strings.h@27,1: unknown type name 'MU_IF'
[Error] strings.h@28,1: unknown type name 'MU_IF'
[Error] strings.h@29,1: unknown type name 'MU_IF'
[Error] strings.h@30,1: unknown type name 'MU_IF'
[Error] strings.h@31,1: unknown type name 'MU_IF'
[Error] strings.h@32,1: unknown type name 'MU_IF'
[Error] strings.h@33,1: unknown type name 'MU_IF'
[Error] strings.h@34,1: unknown type name 'MU_IF'
[Error] strings.h@35,1: unknown type name 'MU_IF'
[Error] strings.h@36,1: unknown type name 'MU_IF'
[Error] strings.h@37,1: unknown type name 'MU_IF'
[Error] strings.h@38,1: unknown type name 'MU_IF'
[Error] strings.h@39,1: unknown type name 'MU_IF'
[ERROR] In file included from ./c-utility/inc/azure_c_shared_utility/strings.h:13:0,
from /usr/arm-none-eabi/include/string.h:24,
from ./deps/azure-macro-utils-c/inc/azure_macro_utils/macro_utils.h:17,
from ./deps/umock-c/inc/umock_c/umock_c_prod.h:4,
from ./c-utility/inc/azure_c_shared_utility/agenttime.h:16,
from ./c-utility/adapters/agenttime_mbed.c:4:
./c-utility/inc/azure_c_shared_utility/strings.h:21:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, STRING_HANDLE, STRING_new);
^
./c-utility/inc/azure_c_shared_utility/strings.h:22:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, STRING_HANDLE, STRING_clone, STRING_HANDLE, handle);
^
./c-utility/inc/azure_c_shared_utility/strings.h:23:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, STRING_HANDLE, STRING_construct, const char*, psz);
^
./c-utility/inc/azure_c_shared_utility/strings.h:24:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, STRING_HANDLE, STRING_construct_n, const char*, psz, size_t, n);
^
./c-utility/inc/azure_c_shared_utility/strings.h:25:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, STRING_HANDLE, STRING_new_with_memory, const char*, memory);
^
./c-utility/inc/azure_c_shared_utility/strings.h:26:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, STRING_HANDLE, STRING_new_quoted, const char*, source);
^
./c-utility/inc/azure_c_shared_utility/strings.h:27:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, STRING_HANDLE, STRING_new_JSON, const char*, source);
^
./c-utility/inc/azure_c_shared_utility/strings.h:28:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, STRING_HANDLE, STRING_from_byte_array, const unsigned char*, source, size_t, size);
^
./c-utility/inc/azure_c_shared_utility/strings.h:29:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, void, STRING_delete, STRING_HANDLE, handle);
^
./c-utility/inc/azure_c_shared_utility/strings.h:30:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, int, STRING_concat, STRING_HANDLE, handle, const char*, s2);
^
./c-utility/inc/azure_c_shared_utility/strings.h:31:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, int, STRING_concat_with_STRING, STRING_HANDLE, s1, STRING_HANDLE, s2);
^
./c-utility/inc/azure_c_shared_utility/strings.h:32:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, int, STRING_quote, STRING_HANDLE, handle);
^
./c-utility/inc/azure_c_shared_utility/strings.h:33:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, int, STRING_copy, STRING_HANDLE, s1, const char*, s2);
^
./c-utility/inc/azure_c_shared_utility/strings.h:34:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, int, STRING_copy_n, STRING_HANDLE, s1, const char*, s2, size_t, n);
^
./c-utility/inc/azure_c_shared_utility/strings.h:35:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, const char*, STRING_c_str, STRING_HANDLE, handle);
^
./c-utility/inc/azure_c_shared_utility/strings.h:36:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, int, STRING_empty, STRING_HANDLE, handle);
^
./c-utility/inc/azure_c_shared_utility/strings.h:37:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, size_t, STRING_length, STRING_HANDLE, handle);
^
./c-utility/inc/azure_c_shared_utility/strings.h:38:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, int, STRING_compare, STRING_HANDLE, s1, STRING_HANDLE, s2);
^
./c-utility/inc/azure_c_shared_utility/strings.h:39:1: error: unknown type name 'MU_IF'
MOCKABLE_FUNCTION(, int, STRING_replace, STRING_HANDLE, handle, char, target, char, replace);
The text was updated successfully, but these errors were encountered: