飞扬围棋

标题: 求助SGF文件分割 [打印本页]

作者: forjoke21cn    时间: 2019-5-21 16:47
标题: 求助SGF文件分割
https://homepages.cwi.nl/~aeb/go/sgfutils/html/sgfsplit.html

下载包是一些c源程序,尝试编译搞不定。哪位老大有空帮忙生成一个可执行文件,只要sgfplit就可以了。

先谢过!

源程序在 https://homepages.cwi.nl/~aeb/go/sgfutils/html/sgfutils.html



作者: lu01    时间: 2019-7-9 19:50
需要linux C source, written for a Linux environment.
作者: lu01    时间: 2019-7-10 13:44
在termux编译有问题

  1. $ make
  2. cc -Wall -Wmissing-prototypes -O3   -c -o sgf.o sgf.c
  3. sgf.c:90:7: warning: implicitly declaring library
  4.       function 'rindex' with type 'char *(const
  5.       char *, int)'
  6.       [-Wimplicit-function-declaration]
  7.                 s = rindex(idbuf, '-');
  8.                     ^
  9. sgf.c:90:7: note: include the header <strings.h>
  10.       or explicitly provide a declaration for
  11.       'rindex'
  12. 1 warning generated.
  13. cc -Wall -Wmissing-prototypes -O3   -c -o errexit.o errexit.c
  14. cc -Wall -Wmissing-prototypes -O3   -c -o readsgf.o readsgf.c
  15. cc -Wall -Wmissing-prototypes -O3   -c -o xmalloc.o xmalloc.c
  16. cc   sgf.o errexit.o readsgf.o xmalloc.o   -o sgf
  17. /data/data/com.termux/files/usr/bin/aarch64-linux-android-ld: sgf.o: in function `write_gametree':
  18. sgf.c:(.text+0x630): undefined reference to `rindex'
  19. clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
  20. make: *** [<builtin>: sgf] Error 1
复制代码

作者: lu01    时间: 2019-7-10 16:27
#define rindex strrchr 就可以了
作者: lu01    时间: 2019-7-10 17:01
可以
cat 5*.sgf >d.sgf
$ ./sgfsplit d.sgf
$ ls *sgf
578418.sgf  X-0001.sgf  d.sgf                    578446.sgf  X-0002.sgf  sgf
$ ls -l *sgf
-rw-------    1 u0_a131  u0_a131       2785 Jul 10 14:16 578418.sgf
-rw-------    1 u0_a131  u0_a131       2490 Jul 10 15:53 578446.sgf
-rw-------    1 u0_a131  u0_a131       2784 Jul 10 16:58 X-0001.sgf
-rw-------    1 u0_a131  u0_a131       2489 Jul 10 16:58 X-0002.sgf
-rw-------    1 u0_a131  u0_a131       5275 Jul 10 16:57 d.sgf
作者: forjoke21cn    时间: 2019-7-11 00:48
谢谢版主




欢迎光临 飞扬围棋 (http://bbs.flygo.net/bbs/) Powered by Discuz! X3.2