如何在c项目中从lib创建dll [英] how to create dll from lib in c project

查看:84
本文介绍了如何在c项目中从lib创建dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我分配了一个旧的c项目来重新编译它。我只是c编程的初学者,所以我需要你的帮助,我在visual c ++ 6.0中打开工作区,工作区由三个项目组成。一旦成功构建,其中两个将创建.lib。一旦我构建了这个项目的创建.exe文件,这两个.libs就用在另一个项目中。当我试图在所需的机器上运行该exe时,它会弹出w32xpgml.dll缺失错误。在主项目中,我发现项目中包含了一个w32xpgml.lib文件。看来我需要将w32xpgml.dll文件放在windows\system32文件夹中。我经历过几个论坛,并且知道我们可以从.h,.lib,.c文件构建dll。我从在线下载libview.exe文件来查看w32xpgml.lib文件中的内容,它只显示常量名称。我使用libview.exe文件从.lib文件创建了.h文件。我现在在那里如何创建.c文件,似乎w32xpgml.lib文件中有任何方法。我正在做的过程是对的???请有人建议我。抱歉我的英文不好,并提前感谢...

Hi guys,

I got allocated a old c project to recompile it . I am just beginner in c programming,so i need your help guys, I opened workspace in visual c++6.0 the workspace consists of three projects. Two of them will create .lib once they build successfully. These two .libs are used in another project once i build this project its creating .exe file. while i am trying to run that exe in desired machine it pop ups w32xpgml.dll missing error. In the main project i found a w32xpgml.lib file inculded in the project. It seems that i need that w32xpgml.dll file to drop that in windows\system32 folder. I been through few forums and came to know that we can build dll from .h,.lib,.c files . i downloaded libview.exe file from online to view whats in that w32xpgml.lib file it shows just constants names . i created .h file from that .lib file using libview.exe file. I struck there now how can i create .c files and it seems that there is any methods in that w32xpgml.lib file .Is the process i am doing is right??? could someone suggest me please . sorry for my bad english and thanks in advance guys..

推荐答案

对于DLL,.lib文件只是一个存根,允许您的代码链接。



在运行时,加载DLL并完成函数地址的修复,以便程序可以调用DLL中实现的代码。



换句话说,lib不包含代码,但它只是一个地址簿,告诉程序如何在运行时访问它。



您需要构建DLL的源代码或运行此应用程序的计算机上的DLL副本。
For DLLs, .lib files are simply a stub to allow your code to link against.

At run time, the DLL is loaded and a fixup of function addresses is done so that your program can make calls into the code that is implemented in the DLL.

So in other words, the lib doesn''t contain the code, but is simply an address book that tells the program how to access it at run time.

You need either the source code to build the DLL, or a copy of the DLL from a machine running this app.


这篇关于如何在c项目中从lib创建dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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