Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to call C function/library in C++

35 views
Skip to first unread message

fl

unread,
Jun 10, 2015, 4:21:25 PM6/10/15
to
Hi,

I know there is a fast C library (NE10) for ARM processor. If a new project
is required to write in C++, how to use the old C function? I am new to gcc
etc. under Linux. What should be taken care of in advance.



NE10 has such functions defined:


ne10_result_t ne10_mulc_float_c (ne10_float32_t *dst, ne10_float32_t *src,
const ne10_float32_t cst, ne10_uint32_t count)

void ne10_fir_float_c (const ne10_fir_instance_f32_t *S, ne10_float32_t
*pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)





Thanks,

Christian Gollwitzer

unread,
Jun 10, 2015, 4:32:03 PM6/10/15
to
Am 10.06.15 um 22:21 schrieb fl:
> I know there is a fast C library (NE10) for ARM processor. If a new project
> is required to write in C++, how to use the old C function? I am new to gcc
> etc. under Linux. What should be taken care of in advance.
>

Put the declarations into extern "C" { } blocks.

>
> NE10 has such functions defined:
>
>
> ne10_result_t ne10_mulc_float_c (ne10_float32_t *dst, ne10_float32_t *src,
> const ne10_float32_t cst, ne10_uint32_t count)
>
> void ne10_fir_float_c (const ne10_fir_instance_f32_t *S, ne10_float32_t
> *pSrc, ne10_float32_t *pDst, ne10_uint32_t blockSize)
>

some header files even do this for you like
#ifdef _cplusplus
extern "C" {
#endif
... here comes the C functions
#ifdef _cplusplus
}
#endif


if not, you can include the header file in an extern C block.

Christian

fl

unread,
Jun 10, 2015, 5:06:32 PM6/10/15
to
Thanks for the prompt reply. I am still new to C++. What and how many
ways to use the C result (data block) in C++? Could you give me a little
more explanation?

Ian Collins

unread,
Jun 10, 2015, 11:14:42 PM6/10/15
to
The same way as you would use it in C, unless you want to do something
in a C++ way.

--
Ian Collins
0 new messages