我正在尝试编译一个包含MRuby库并执行一些简单的ruby代码的Contiki应用程序。问题是,我不知道如何在编译中包含MRuby库。
这是一个项目:https://github.com/matus-tomlein/contiki-mruby-example/tree/wrong
我想要执行的代码在contiki-mruby-example.c中。问题可能在Makefile中。这就是我目前的情况:
CONTIKI_PROJECT = contiki-mruby-example
all: $(CONTIKI_PROJECT)
CONTIKIDIRS += mruby/include
CFLAGS += -v
CFLAGS += -Imruby/include
CONTIKI = contiki
include $(CONTIKI)/Makefile.include执行make时会出现以下错误
ld: can't map file, errno=22 file 'mruby/include' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)我想要包含的MRuby代码在mruby/include中。
这是一个类似的问题:How to use external libraries and compile them along with a Contiki application,但使用TARGET_LIBFILES或LDFLAGS没有帮助。我想这是因为我正在编译普通的源代码,而不是库。
可能有一个简单的答案,我错过了。谢谢你的建议。
发布于 2015-01-26 15:56:57
谢谢@kfx的评论,你说得对,我应该把Makefile中的库链接起来。
只是为了帮助其他可能有这个问题的人:
makeTARGET_LIBFILES += mruby/build/host/lib/libmruby.a我已经用修复:https://github.com/matus-tomlein/contiki-mruby-example更新了示例repo
https://stackoverflow.com/questions/28151814
复制相似问题