rogueをMacでビルドしたくなりました。
## rogue donwload
http://www.anthive.com/project/rogue/
## Rogueのビルド
```bash
`gutter:false;
$ wget http://www.anthive.com/rog/rogue5.4.4-ant-r1.1.2-src.tar.gz
$ tar xzvf rogue5.4.4-ant-r1.1.2-src.tar.gz
$ ./configure
```
エラーになった...
```
`gutter:false;
main.c:279:9: error: incomplete definition of type 'struct _win_st'
curscr->_cury = oy;
~~~~~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/curses.h:322:16: note:
forward declaration of 'struct _win_st'
typedef struct _win_st WINDOW;
^
main.c:280:9: error: incomplete definition of type 'struct _win_st'
curscr->_curx = ox;
~~~~~~^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/curses.h:322:16: note:
forward declaration of 'struct _win_st'
typedef struct _win_st WINDOW;
^
2 errors generated.
make: *** [main.o] Error 1
```
ncursesをインストールして, Makefileを書き変える
```
`gutter:false;
$ brew install pkg-config
```
Makefileの変更は以下の通り
```
`gutter:false;
+CPPFLAGS = -DHAVE_CONFIG_H -I/usr/local/opt/ncurses/include
+
+LDFLAGS = -L/usr/local/opt/ncurses/lib
```
今度はこのエラー
```
`gutter:false;
gcc -g -O2 -DHAVE_CONFIG_H -I/usr/local/opt/ncurses/include -c mdport.c
mdport.c:267:15: error: incomplete definition of type 'struct term'
if (cur_term->type.Strings == NULL)
~~~~~~~~^
/usr/local/opt/ncurses/include/term.h:710:16: note: forward declaration of 'struct term'
typedef struct term TERMINAL;
^
1 error generated.
make: *** [mdport.o] Error 1
```
Makefileの
フラグを以下の様に変更したら通った
(/usr/local/opt/ncurses/include/term.hを見たらDNCURSES_INTERNALSが1だとtermの定義がされないっぽい)
```
`gutter:false;
#CPPFLAGS=-DHAVE_CONFIG_H
#CPPFLAGS =-DHAVE_CONFIG_H
CPPFLAGS = -DHAVE_CONFIG_H -I/usr/local/opt/ncurses/include -DNCURSES_INTERNALS=0
LDFLAGS = -L/usr/local/opt/ncurses/lib
```
0 件のコメント :
コメントを投稿