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

Cannot compile using CMake on macOS #271

Closed
sgerbino opened this issue Sep 20, 2016 · 1 comment
Closed

Cannot compile using CMake on macOS #271

sgerbino opened this issue Sep 20, 2016 · 1 comment

Comments

@sgerbino
Copy link
Contributor

CMakeLists.txt does not work on macOS. See error output below:

pluto:build sgerbino$ cmake ..
-- The C compiler identification is AppleClang 8.0.0.8000038
-- The CXX compiler identification is AppleClang 8.0.0.8000038
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/sgerbino/Workspace/json-c/build
pluto:build sgerbino$ make
Scanning dependencies of target json-c
[ 11%] Building C object CMakeFiles/json-c.dir/arraylist.c.o
/Users/sgerbino/Workspace/json-c/arraylist.c:26:9: warning: 'SIZE_T_MAX' macro redefined [-Wmacro-redefined]
#define SIZE_T_MAX UINT_MAX
        ^
/usr/include/i386/limits.h:98:9: note: previous definition is here
#define SIZE_T_MAX      ULONG_MAX       /* max value for a size_t */
        ^
1 warning generated.
[ 22%] Building C object CMakeFiles/json-c.dir/debug.c.o
[ 33%] Building C object CMakeFiles/json-c.dir/json_object.c.o
In file included from /Users/sgerbino/Workspace/json-c/json_object.c:30:
/Users/sgerbino/Workspace/json-c/math_compat.h:9:9: warning: 'isnan' macro redefined [-Wmacro-redefined]
#define isnan(x) _isnan(x)
        ^
/usr/include/math.h:178:9: note: previous definition is here
#define isnan(x)                                                         \
        ^
In file included from /Users/sgerbino/Workspace/json-c/json_object.c:30:
/Users/sgerbino/Workspace/json-c/math_compat.h:16:9: warning: 'isinf' macro redefined [-Wmacro-redefined]
#define isinf(x) (!_finite(x))
        ^
/usr/include/math.h:173:9: note: previous definition is here
#define isinf(x)                                                         \
        ^
In file included from /Users/sgerbino/Workspace/json-c/json_object.c:30:
/Users/sgerbino/Workspace/json-c/math_compat.h:22:9: warning: 'INFINITY' macro redefined [-Wmacro-redefined]
#define INFINITY (DBL_MAX + DBL_MAX)
        ^
/usr/include/math.h:68:9: note: previous definition is here
#define INFINITY    HUGE_VALF
        ^
In file included from /Users/sgerbino/Workspace/json-c/json_object.c:30:
/Users/sgerbino/Workspace/json-c/math_compat.h:27:9: warning: 'NAN' macro redefined [-Wmacro-redefined]
#define NAN (INFINITY - INFINITY)
        ^
/usr/include/math.h:60:15: note: previous definition is here
#   define    NAN          __builtin_nanf("0x7fc00000")
              ^
/Users/sgerbino/Workspace/json-c/json_object.c:43:3: error: You do not have snprintf on your system.
# error You do not have snprintf on your system.
  ^
/Users/sgerbino/Workspace/json-c/json_object.c:677:6: warning: implicit declaration of function '_isnan' is invalid in C99 [-Wimplicit-function-declaration]
  if(isnan(jso->o.c_double))
     ^
/Users/sgerbino/Workspace/json-c/math_compat.h:9:18: note: expanded from macro 'isnan'
#define isnan(x) _isnan(x)
                 ^
/Users/sgerbino/Workspace/json-c/json_object.c:679:11: warning: implicit declaration of function '_finite' is invalid in C99 [-Wimplicit-function-declaration]
  else if(isinf(jso->o.c_double))
          ^
/Users/sgerbino/Workspace/json-c/math_compat.h:16:20: note: expanded from macro 'isinf'
#define isinf(x) (!_finite(x))
                   ^
6 warnings and 1 error generated.
make[2]: *** [CMakeFiles/json-c.dir/json_object.c.o] Error 1
make[1]: *** [CMakeFiles/json-c.dir/all] Error 2
make: *** [all] Error 2
@hawicz
Copy link
Member

hawicz commented Sep 22, 2016

MacOS can use configure and build normally. I'd say this is not a problem.

@hawicz hawicz closed this as completed Sep 22, 2016
sgerbino added a commit to sgerbino/json-c that referenced this issue Sep 25, 2016
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