wrap a c++ library in c? (don't “extern c”)

后端 未结 5 1543
走了就别回头了
走了就别回头了 2021-01-12 18:29

is it possible to wrap a c++ library into c?

how could i do this?

are there any existing tools?

(need to get access to a existing c++ library but on

5条回答
  •  自闭症患者
    2021-01-12 18:56

    If the C++ library is written which can be compiled with C compiler with slight editting (such as changing bool to int, false to 0 and true to 1 etc), then that can be done.

    But not all C++ code can be wrapped in C. Template is one feature in C++ that cannot be wrapped, or its nearly impossible.

提交回复
热议问题