将C ++头文件转换为DLL [英] Convert c++ header File to dll

查看:266
本文介绍了将C ++头文件转换为DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Jpegxr编码.但我在Microsoft网站上找到了编码器标头来源.但是它们是用c ++编写的!我不知道.
我怎么也可以将此代码编译为dll?
我在互联网上搜索它,发现了一种方法,但我不明白...

这是微软高清照片套件:
http://www.microsoft.com /downloads/details.aspx?FamilyID=285eeffd-d86c-48c3-ab93-3abd5ee7f1ce&displaylang=en[^] [解决方案

将标头编译为DLL毫无意义:标头仅包含函数的声明,以便您的编译器可以知道如何调用它们,但不包含任何定义(将执行的代码).

在下载中,如果有".h",则还应该有".dll"和".lib". ".lib"应静态链接到您的项目,以使编译器进行的调用映射到DLL的相应条目中.

如果DLL和LIB不在下载中,则可能是它们已经在系统中了.

请查看文档.


C ++ 项目转换为 C#需要对两种语言都有很好的了解,并且可能需要更改源代码中的许多内容.
最好的方法是使用 C ++/CLI 来包装 native 项目,这种方式可以在受管世界中使用.

我下载的文件中没有DLL或LIB文件.
此链接是使用c ++语言的jpegxr解码器和编码器源.
我想一步一步地做,但是我不能用c#编写它. .我如何才能将此源从C ++转换为C#并使用它们?


I want to use Jpegxr coding . but I found coder header source in microsoft website . but they are in c++ ! and I don''t know it .
How can I compile this code too dll?
i search it in internet and found one way but I don''t understand it ...

this is microsoft HD photo Kit :
http://www.microsoft.com/downloads/details.aspx?FamilyID=285eeffd-d86c-48c3-ab93-3abd5ee7f1ce&displaylang=en[^][^]

before every think...tanx

解决方案

Compiling a header into DLL makes no sense: a header contains only the declarations of the functions so that your compiler can know how to call them, but doesnt''t contain any definition (the code that will be execute).

In the download, if there is a ".h", there should be also a ".dll" and a ".lib". The ".lib" should be statically linked to your project to let the the call made by the complier mapped in the corresponding entry of the DLL.

If the DLL and LIB are not in the download, probably they are supposed to be already in the system.

Check the documentation for that.


Convert a C++ project to C# requires a good knowledge of both the languages, and probably requires to change a lot of things in the source code.
The best way is to use C++/CLI to wrap the native project in a way that could be used from the managed world.


there is not DLL or LIB file included in my downloaded files .
this link is a jpegxr decoder and encoder source with c++ language .
I want to do it Step by Step and i can not write it in c# . . how can i convert this source from C++ to C# and use them?


这篇关于将C ++头文件转换为DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆