我正在尝试使用 i686-w64-mingw32-g++ 编译器从 Linux 编译一个简单的 chaiscript 示例。我已经让它与 g++ 一起工作,但是在使用命令编译我的应用程序时
i686-w64-mingw32-g++ ./main.cpp -pthread -L/lib/x86_64-linux-gnu/libdl.a -std=c++17
这是 main.cpp 的内容
#include "chaiscript/chaiscript.hpp"
#include "chaiscript/chaiscript_stdlib.hpp"
int main()
{
chaiscript::ChaiScript chai;
chai.eval(R"(puts("Hello"))");
}
如何修复此错误以便编译我的代码?
编辑:
通过使用 x86_64-w64-mingw32-g++ 而不是 i686-w64-mingw32-g++,我能够走得更远,但现在我收到了这个错误:
/usr/bin/x86_64-w64-mingw32-as: /tmp/ccE1ZcKe.o: too many sections (73147)
/tmp/ccwlaMBb.s: Assembler messages:
/tmp/ccwlaMBb.s: Fatal error: can't write 41 bytes to section .text of /tmp/ccE1ZcKe.o: 'file too big'
/usr/bin/x86_64-w64-mingw32-as: /tmp/ccE1ZcKe.o: too many sections (73147)
/tmp/ccwlaMBb.s: Fatal error: can't close /tmp/ccE1ZcKe.o: file too big