Skip to content
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

Failed to build on OSX and gcc #128

Closed
mredd opened this issue Nov 2, 2017 · 5 comments
Closed

Failed to build on OSX and gcc #128

mredd opened this issue Nov 2, 2017 · 5 comments
Assignees
Labels

Comments

@mredd
Copy link

mredd commented Nov 2, 2017

Hi folks,

I'm trying to build the c-utility as part of the azure-iot-sdk for C, but stumble right upon the first file to be compiled. GCC spits out an error log of 61 kB, so I'm putting this into an attachment instead of pasting thousand lines of error messages here. Here are just the first two errors, because these are the ones repeated most:

In file included from <build-dir>/azure-iot-sdk-src/c-utility/inc/azure_c_shared_utility/umock_c_prod.h:23:0,
                 from <build-dir>/azure-iot-sdk-src/c-utility/inc/azure_c_shared_utility/buffer_.h:16,
                 from <build-dir>/azure-iot-sdk-src/c-utility/src/base32.c:8:
<build-dir>/azure-iot-sdk-src/c-utility/inc/azure_c_shared_utility/macro_utils.h:22951:51: error: unknown type name 'IF2'; did you mean 'IF'?
 #define IF(condition, trueBranch, falseBranch) C2(IF,ISZERO(condition))(trueBranch, falseBranch)
                                                   ^
<build-dir>/azure-iot-sdk-src/c-utility/inc/azure_c_shared_utility/macro_utils.h:6985:18: note: in definition of macro 'C2_'
 #define C2_(x,y) x##y
                  ^
<build-dir>/azure-iot-sdk-src/c-utility/inc/azure_c_shared_utility/macro_utils.h:22951:48: note: in expansion of macro 'C2'
 #define IF(condition, trueBranch, falseBranch) C2(IF,ISZERO(condition))(trueBranch, falseBranch)
                                                ^~
<build-dir>/azure-iot-sdk-src/c-utility/inc/azure_c_shared_utility/umock_c_prod.h:31:31: note: in expansion of macro 'IF'
     result modifiers function(IF(COUNT_ARG(__VA_ARGS__),,void) FOR_EACH_2_COUNTED(UMOCK_C_PROD_ARG_IN_SIGNATURE, __VA_ARGS__));
                               ^~
<build-dir>/azure-iot-sdk-src/c-utility/inc/azure_c_shared_utility/buffer_.h:20:1: note: in expansion of macro 'MOCKABLE_FUNCTION'
 MOCKABLE_FUNCTION(, BUFFER_HANDLE, BUFFER_new);
 ^~~~~~~~~~~~~~~~~
In file included from <build-dir>/azure-iot-sdk-src/c-utility/src/base32.c:8:0:
<build-dir>/azure-iot-sdk-src/c-utility/inc/azure_c_shared_utility/buffer_.h:20:1: error: macro "FOR_EACH_2_COUNTED_2" requires 3 arguments, but only 2 given
 MOCKABLE_FUNCTION(, BUFFER_HANDLE, BUFFER_new);
 ^~~~~~~~~~~~~~~~~~~~

I've tried to fix this on my own for two days now, but I'm totally lost in the utterly complex macro stuff you guys are doing there. And since this is the default build (I just ran cmake), I post this now as an issue to be hopefully fixed soon by the maintainers. Let me know if you need further input or some further tests to be conducted.

My environment is OSX 10.11.6 with homebrew's gcc 7.2.0. In contrast, the code builds without any warning when using Apple's clang (Apple LLVM version 8.0.0 (clang-800.0.42.1)).

Attachments:
build.log

@ewertons
Copy link
Contributor

Hey @mredd, sorry for the delay, we missed your question.
Are you still experiencing this error, or you found the solution?

Just so we have more info, what is the version of the SDK you are trying to build?

@mredd
Copy link
Author

mredd commented Nov 21, 2017

I'm just confused that the C-utility doesn't build when just checked out. I thought it was worth noticing the developers.

@tameraw
Copy link
Contributor

tameraw commented Jan 18, 2018

@jebrando - Please confirm and close if fixed already. Thanks.

@jebrando
Copy link
Contributor

jebrando commented Apr 5, 2018

The SDK build successfully on Mac.

@jebrando jebrando closed this as completed Apr 5, 2018
@tameraw
Copy link
Contributor

tameraw commented Apr 23, 2018

@mredd thank you for your contribution to our open-sourced project!  Please help us improve by filling out this 2-minute customer satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants