Arduino compiler can't find implemented methods in C library -
i wrote own library arduino leonardo. consists of header files , defined methods implemented in *.c-files. when compile eclipse works fine, compiler of arduino ide doesn't methods. returns error messages:
impl.cpp:20: undefined reference initopticom() impl.cpp:21: undefined reference calc(unsigned char*, int) impl.cpp:25: undefined reference getinitseq(unsigned char*, long*, long) impl.cpp:32: undefined reference decode(unsigned char*, long) collect2: error: ld returned 1 exit status
all files can found in arduino library dir , libraries included... searched examples implement c-library arduino found c++.
maybe know what's wrong here, tried lot failed :(
perhaps it's name mangling. either declare functions extern "c"
, or compile them c++ (rename file .cpp
or pass -x c++
flag gcc when compiling).
Comments
Post a Comment