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

Librdkafka does not compile on OSX 10.8.5 #33

Closed
xiaojun789 opened this issue Dec 9, 2013 · 5 comments
Closed

Librdkafka does not compile on OSX 10.8.5 #33

xiaojun789 opened this issue Dec 9, 2013 · 5 comments
Milestone

Comments

@xiaojun789
Copy link

Hi
I try to build the library in my Mac, but it failed. My mac info is:

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix

the error message is:

cc -MD -MP -O2 -Wall -Werror -Wfloat-equal -Wpointer-arith -fPIC -I. -g -DSG -c rdkafka.c
rdkafka.c:1064:29: error: use of GNU old-style field designator extension [-Werror,-Wgnu-designator]
        struct consume_ctx ctx = { consume_cb: consume_cb, opaque: opaque };
                                   ^~~~~~~~~~~
                                   .consume_cb = 
rdkafka.c:1064:53: error: use of GNU old-style field designator extension [-Werror,-Wgnu-designator]
        struct consume_ctx ctx = { consume_cb: consume_cb, opaque: opaque };
                                                           ^~~~~~~
                                                           .opaque = 
2 errors generated.
make: *** [rdkafka.o] Error 1
@edenhill
Copy link
Contributor

edenhill commented Dec 9, 2013

Try: CC=clang make

or add -Wno-gnu-designator to CFLAGS in Makefile

@xiaojun789
Copy link
Author

error message like this when I try you method

clang -MD -MP -O2 -Wall -Werror -Wfloat-equal -Wpointer-arith -fPIC -I. -g -Wno-gnu-designator -DSG -c rdkafka.c
clang -MD -MP -O2 -Wall -Werror -Wfloat-equal -Wpointer-arith -fPIC -I. -g -Wno-gnu-designator -DSG -c rdkafka_broker.c
rdkafka_broker.c:2192:22: error: implicit declaration of function 'be64toh' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                hdr->Offset      = be64toh(hdr->Offset);
                                   ^
rdkafka_broker.c:2793:30: error: implicit declaration of function 'htobe64' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        part2->Time               = htobe64(rktp->rktp_query_offset);
                                    ^
2 errors generated.
make: *** [rdkafka_broker.o] Error 1

@xiaojun789
Copy link
Author

I found something useful for this issue, and use it, the library can build successfully in my mac
https://gist.github.com/yinyin/2027912

@gpatmore gpatmore mentioned this issue Jan 3, 2014
@edenhill
Copy link
Contributor

edenhill commented Jan 4, 2014

Hi @xiaojun789, could you update your master checkout and try again.
Compile support for OSX 10.9 was just merged and I hope it fixes 10.8 aswell.

@edenhill
Copy link
Contributor

edenhill commented Jan 8, 2014

Reopen if still problems

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

No branches or pull requests

2 participants