【问题标题】:Installing eggs in Chicken Scheme在鸡计划中安装鸡蛋
【发布时间】:2018-02-15 11:07:14
【问题描述】:

在 MSYS2 中,我尝试使用以下方法安装鸡蛋::

chicken-install http-client

我收到如下几个错误:

"c:\msys64\usr\local\bin\csc" -feature compiling-extension -setup-mode    mathh.scm -shared -optimize-leaf-routines -inline -output-file mathh.so -emit-import-library mathh -emit-type-file mathh.types -local -no-procedure-checks
mathh.c:24:1: error: static declaration of 'log2' follows non-static declaration
 log2( double x )
 ^~~~
In file included from c:/msys64/usr/local/include/chicken/chicken.h:131:0,
                 from mathh.c:11:
C:/msys64/mingw64/x86_64-w64-mingw32/include/math.h:773:25: note: previous declaration of 'log2' was here
   extern double __cdecl log2 (double);
                         ^~~~
mathh.c:41:1: error: static declaration of 'log1p' follows non-static declaration
 log1p( double x )
^~~~~

编辑

依赖:

chicken-install mathh

给予:

...
mathh.c: In function 'stub181':
mathh.c:357:19: warning: implicit declaration of function 'mm_hypot'; did you mean '_hypot'? [-Wimplicit-function-declaration]
 C_r=C_flonum(&C_a,mm_hypot(t0,t1));
                   ^~~~~~~~
                   _hypot
mathh.o:mathh.c:(.text+0x177f): undefined reference to `mm_hypot'
collect2.exe: error: ld returned 1 exit status

Error: shell command terminated with non-zero exit status 1: ""gcc" "mathh.o" -o "mathh.so" -Wl,--enable-auto-import -shared -Lc:\msys64\usr\local\lib\ -lchicken -lm -lws2_32"

Error: shell command failed with nonzero exit status 1:

  ""c:\msys64\usr\local\bin\csc" -feature compiling-extension -setup-mode    mathh.scm -shared -optimize-leaf-routines -inline -output-file mathh.so -emit-import-library mathh -emit-type-file mathh.types -local -no-procedure-checks"


Error: shell command terminated with nonzero exit code
70
"\"\"c:\\msys64\\usr\\local\\bin\\csi\" -bnq -setup-mode -e \"(require-lib...

编辑

@krl 提出的修复:

msys2_shell.cmd -mingw64 # see http://wiki.call-cc.org/msys2
export CHICKEN_PREFIX="c:\msys64\usr\local\\"
export CHICKEN_REPOSITORY="c:\msys64\usr\local\lib\chicken\8\\"
chicken-install -retrieve mathh
sed  -i.bak -r 's/define +mathh-compile-options.+\(/&\n  -C -mwin32/' ./mathh/mathh.setup
chicken-install test
chicken-install -test -transport local -location . mathh

这仍然会出现以下错误:

...

installing mathh: ...
changing current directory to C:\msys64\home\user\.\mathh
  ""c:\msys64\usr\local\bin\csi" -bnq -setup-mode -e "(require-library setup-api)" -e "(import setup-api)" -e "(setup-error-handling)" -e "(extension-name-and-version '(\"mathh\" \"\"))" "mathh.setup""
  "c:\msys64\usr\local\bin\csc" -feature compiling-extension -setup-mode mathh.scm -shared -optimize-leaf-routines -inline -output-file mathh.so -emit-import-library mathh -emit-type-file mathh.types -local -no-procedure-checks
mathh.c:29:1: error: static declaration of 'log2' follows non-static declaration
 log2( double x )
 ^~~~
In file included from c:/msys64/usr/local/include/chicken/chicken.h:131:0,
                 from mathh.c:11:
C:/msys64/mingw64/x86_64-w64-mingw32/include/math.h:773:25: note: previous                                   declaration of 'log2' was here
   extern double __cdecl log2 (double);
                         ^~~~
... further errors like above

【问题讨论】:

    标签: scheme chicken-scheme


    【解决方案1】:

    看起来这是数学蛋中的一个错误。我已经请它的作者看一下,他已经发布了一个新版本。可以再试一次吗?

    【讨论】:

    • 我运行chicken-install mathh。仍然没有运气。请参阅问题编辑。
    【解决方案2】:

    来自http://www.davidegrayson.com/windev/msys2/ 似乎需要 MSYS2 -mwin32 gcc 选项来定义 _WIN32。 mathh 使用 defined(_WIN32) 来触发 log2 等的 q&d 实现对 windows 的扩展。

    可以修改 mathh egg mathh.setup 文件以提供编译选项。请参阅 mathh.setup 中 mathh-compile-options 的定义。

    ex: (define mathh-compile-options '(-local -no-procedure-checks -mwin32))
    

    【讨论】:

    • 对不起 : (define mathh-compile-options '(-local -no-procedure-checks -C -mwin32))
    • 据我了解,这假设我应该单独下载mathh egg,修改mathh.setup并重新编译。关于如何做到这一点的任何指针?
    • cd chicken-install -retrieve mathh ... 编辑 ./mathh/mathh.setup ... chicken-install -test -transport local -location 。数学
    • 仍然出现构建错误。请检查我的最后一个问题编辑。
    • 为什么没有定义_WIN32?尝试显式 def : (define mathh-compile-options `(-local -no-procedure-checks -C -D_WIN32)
    【解决方案3】:

    我刚刚发布了http-client 0.16 版,在此我删除了过于复杂的md5 依赖项,并将其替换为新的simple-md5 egg。

    这应该更容易安装。它应该很快就会出现在蛋镜上。

    【讨论】:

      猜你喜欢
      • 2017-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-21
      • 2011-02-17
      • 2013-07-11
      • 1970-01-01
      相关资源
      最近更新 更多