DanielT / NitroHack

A fork of NetHack 3.4.3
nitrohack.org
21 stars 2 forks source link

make fails on OSX 10.5 #13

Open egilburg opened 12 years ago

egilburg commented 12 years ago

Following the build instructions up to the make command. Get the following error at 86%:

Scanning dependencies of target libnitrohack_client
[ 86%] Building C object libnitrohack_client/CMakeFiles/libnitrohack_client.dir/src/clientapi.c.o
In file included from /Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:7:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/include/nhclient.h:28:21: error: jansson.h: No such file or directory
In file included from /Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:7:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/include/nhclient.h:44: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/Users/eugene/Downloads/NitroHack/libnitrohack_client/include/nhclient.h:48: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/Users/eugene/Downloads/NitroHack/libnitrohack_client/include/nhclient.h:49: error: expected ‘)’ before ‘*’ token
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_exit_game’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:56: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:56: error: (Each undeclared identifier is reported only once
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:56: error: for each function it appears in.)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:56: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_list_games’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:85: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:85: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:85: error: ‘jarr’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:85: error: ‘jobj’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_restore_game’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:141: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:141: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_start_game’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:166: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:166: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_command’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:188: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:188: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:188: error: ‘jarg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_view_replay_start’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:236: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:236: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_view_replay_step’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:266: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:266: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_get_commands’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:313: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:313: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:313: error: ‘jarr’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:313: error: ‘jobj’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_get_object_commands’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:356: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:356: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:356: error: ‘jarr’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:356: error: ‘jobj’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: At top level:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:396: error: expected ‘)’ before ‘*’ token
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_get_drawing_info’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:422: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:422: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:422: error: ‘jbg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:422: error: ‘jtraps’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:422: error: ‘jobjs’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:422: error: ‘jmons’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:422: error: ‘jwarn’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:422: error: ‘jexpt’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:422: error: ‘jzapt’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:422: error: ‘jzaps’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:423: error: ‘jeff’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:423: error: ‘jexps’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:423: error: ‘jswal’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:423: error: ‘jinvis’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:463: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:464: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:465: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:466: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:467: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:468: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:469: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:470: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:471: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:472: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:473: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:474: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: At top level:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:483: error: expected ‘)’ before ‘*’ token
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:504: error: expected ‘)’ before ‘*’ token
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_set_option’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:609: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:609: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:609: error: ‘joval’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:609: error: ‘jobj’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_get_options’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:664: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:664: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:664: error: ‘jarr’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:664: error: ‘jobj’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_describe_pos’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:718: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:718: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: At top level:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:745: error: expected ‘)’ before ‘*’ token
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_get_roles’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:774: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:774: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:774: error: ‘jroles_m’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:774: error: ‘jroles_f’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:774: error: ‘jraces’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:774: error: ‘jgenders’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:774: error: ‘jaligns’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:774: error: ‘jmatrix’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:805: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:806: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:807: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:808: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:809: warning: assignment makes pointer from integer without a cast
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_build_plselection_prompt’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:827: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:827: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_root_plselection_prompt’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:858: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:858: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_get_topten’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:890: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:890: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:890: error: ‘jarr’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:890: error: ‘jobj’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_change_email’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:958: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:958: error: ‘jmsg’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c: In function ‘nhnet_change_password’:
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:971: error: ‘json_t’ undeclared (first use in this function)
/Users/eugene/Downloads/NitroHack/libnitrohack_client/src/clientapi.c:971: error: ‘jmsg’ undeclared (first use in this function)
make[2]: *** [libnitrohack_client/CMakeFiles/libnitrohack_client.dir/src/clientapi.c.o] Error 1
make[1]: *** [libnitrohack_client/CMakeFiles/libnitrohack_client.dir/all] Error 2
make: *** [all] Error 2

System:

OSX 10.5 make version: 3.8.1 cmake version 2.8.6 gcc version 4.2.1

Dump of the previous cmake command:

-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/eugene/Downloads/NitroHack/build
DanielT commented 12 years ago

There are 2 issues here (that I know of)

The cmake script is currently not good enough to detect that you don't have the jansson library. Get it from http://www.digip.org/jansson/

Additionally, you will encounter a problem with the ncurses header on OS X; apparrently (I have not tried this myself) you can edit line 77 of nitrohack/include/nhcurses.h from "# include <ncursesw/curses.h>" to "# include <curses.h>"

I hope to try building on OS X myself soon and will fix this properly then.

mbi commented 12 years ago

Thanks for the tips, @DanielT, after those two fixes NitroHack compiles and runs like a charm on OS X.

egilburg commented 12 years ago

Did you make the fix? Could you submit the patch as a pull request so it's available in this repo?

mbi commented 12 years ago

@egilburg Surething: added PR #17.