2

我在使用 Gambit-C Scheme 动态加载 Windows 共享库时遇到了麻烦。

(c-declare "#include <stdlib.h>")
(c-declare "#include <Windows.h>")
(define load-library (c-lambda () void "
    HINSTANCE lib = LoadLibrary (\"test.dll\");
    if (lib) printf (\"works!\");
"))
(load-library)

目录结构:

--test.scm
--test.dll

GSC 命令:

gsc -exe test.scm

我已经在纯编译的 C 中对其进行了测试,并在那里加载。谢谢你。

4

1 回答 1

1

Try an absolute path. To test things place test.dll in the root of C. If an absolute path works, you know that the problem is related to the environment variable that holds the search path of dynamic libraries.

于 2015-04-28T11:02:38.300 回答