2
我为Arduino Leonardo编写了自己的库。它由一些头文件组成,所有定义的方法都在* .c文件中实现。当我用Eclipse编译它时,一切正常,但Arduino IDE的编译器不能获取这些方法。它返回的错误信息:Arduino编译器在C库中找不到实现的方法
impl.cpp:20: undefined reference to initOptiCom()
impl.cpp:21: undefined reference to calc(unsigned char*, int)
impl.cpp:25: undefined reference to getInitSeq(unsigned char*, long*, long)
impl.cpp:32: undefined reference to decode(unsigned char*, long)
collect2: error: ld returned 1 exit status
所有文件都可以在Arduino的库目录中找到,所有的库都包含... 我搜索了一些例子,实现C-库Arduino的,但我发现只是一些为C++。
也许你知道什么是错在这里,我尝试了很多却失败:(
真快,谢谢! 我加 “的#ifdef __cplusplus 的extern “C”{ #ENDIF 的#ifdef __cplusplus } //转ern“C” #endif' 围绕它,现在它的工作原理:-) – famalgosner 2013-05-13 21:03:23