简体   繁体   English

编译 cpp 源代码以仅在 c 支持下运行

[英]Compile cpp source to run in c support only

I want to ask about a problem about c/c++ compile I have project need to reuse a library wrote base on Cpp language.我想问一个关于c/c++编译的问题我有项目需要重用一个基于Cpp语言编写的库。 But I need to reuse the library in a project which work on a platform only support c language (UEFI) I want to ask :但是我需要在一个仅支持 c 语言(UEFI)的平台上工作的项目中重用该库我想问:
-Is it possible to write a wrap API in C code to call all function in the Cpp library ? - 是否可以用 C 代码编写包装 API 来调用 Cpp 库中的所有函数?

-And After compiled All of these (Wrap API, CppLibrary,My Source project) by C compiler =>Will the build application is working in my platform (UEFI)? - 并且在通过 C 编译器编译所有这些(Wrap API、CppLibrary、我的源项目)之后 => 构建应用程序是否可以在我的平台 (UEFI) 中运行? "

( Assumption than both Cpp library and My project source in compile in the same compile like (visual c 2013) ) (假设比 Cpp 库和我的项目源在同一个编译中编译(visual c 2013))

Thank you谢谢

您可以编写一个 C API 来包装 C++ 库,但是如果 C++ 库不能在 UEFI 环境中编译和运行,这对您没有任何好处。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM