How to use external libraries and compile them along with a Contiki application

浪尽此生 提交于 2019-12-01 07:22:53

问题


I want to be able to interface some sensors and send the sensor data to Thingspeak cloud using Contiki-OS. C libraries are available for interfacing sensors and the libthingspeak library is available for updating the feed on Thingspeak. I'm able to perform communication between two motes using the examples provided in examples/udp-ipv6 folder, setting one node as client and another as the server. How do I now include the required library code in my application and build it. What changes need to be made in the Makefile? I'm using cc2538 development kit.


回答1:


Use TARGET_LIBFILES variable. For example, to link with standard math library:

TARGET_LIBFILES += -lm

If necessary, add the path where the library resides to LDFLAGS:

LDFLAGS += -L/path/to/libraries


来源:https://stackoverflow.com/questions/26323623/how-to-use-external-libraries-and-compile-them-along-with-a-contiki-application

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!