Forum Discussion
Altera_Forum
Honored Contributor
11 years agoHow use altera_avalon_fifi_xxx with a .cpp file ?
Hi, I try to use altera_avalon_fifo_init() function in .cpp file extension. The compilation is OK but the linker does't find the function defined in bsp (in library libhal_bsp.a). The error is ...
Altera_Forum
Honored Contributor
11 years agoI remember that if you define a function (i.e. testcpp() ) in a cpp file, you must declare it with the extern "C" directive in order to call it from a .c files.
extern "C" int testcpp (int n); int testcpp (int n) { /* function body */ } I think you must use something similar for calling .c functions from .cpp source files.