Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
9 years, 7 months ago. This question has been closed. Reason: Off Topic
Creating .ar for mbed online compiler
How do you create a .ar file for the mbed online compiler? I am using arm-none-eabi-gcc for my toolchain and creating a simple .ar file with one object file inside. The object file is compiled from:
int testFunc( int x ) { return (x+5); }
testFunc is declared in test.h as:
extern int testFunc( int x );
When building a simple blinky program on the online compiler with the .ar and .h file the error: "Undefined symbol testFunc in main" is thrown. Any comments on the build process of a static library for the mbed compiler?
Edit: The error was quite simple: surround the C code by #ifdef cplusplus extern "C" { }