9 years, 3 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" { }

Question relating to:

NSDL C library nsdl