开发者

on C part of C++ project (VS10)

开发者 https://www.devze.com 2023-01-06 15:09 出处:网络
I have a C++ VS2010 project. I want it to be pure C, so I will have a pure C library and a C++ file that will call that library.

I have a C++ VS2010 project. I want it to be pure C, so I will have a pure C library and a C++ file that will call that library.


Yes. See how to mix c and c++.

Of course, you could (probably) just compile the c code with a c++ compiler and save yourself a headache.

If you want to link object files compiled by a c compiler, you'll need to use extern "C" { } to declare the functions, so that they aren't name mangled by the C++ compiler.

It really depends on how you want to build your project. If you're more specific, you'll get better answers.

0

精彩评论

暂无评论...
验证码 换一张
取 消