在没有动态加载库的情况下使用 Chaiscript

Using Chaiscript without dynamically loaded libraries

我正在使用 Intel SGX,并且想在 enclave 中使用 Chaiscript。 SGX 禁止在飞地内使用动态加载的库。有没有办法以这种方式使用 Chaiscript(我无法使用“-ldl”参数进​​行编译)?

查看 Chaiscript 作者 lefticus (Jason Turner) 的评论:

You should never try linking to the chaiscript stdlib, as the compiler is warning you about. ChaiScript is fundamentally a header-only toolkit. It also has the ability to use loadable modules, and it's possible to compile the standard library as one of those loadable modules.

来源在这里: https://github.com/ChaiScript/ChaiScript/issues/126

从 ChaiScript 6.0 开始,标准库已被编译到 ChaiScript 本身。所以那个方面不需要-ldl.

您正在寻找的是 -DCHAISCRIPT_NO_DYNLOAD 选项,它完全禁用了动态加载库的能力,并且不需要链接到动态加载程序。