是否可以使用lib和dll文件而不包括标题? [英] is it possible to use lib and dll files without including headers ?

查看:115
本文介绍了是否可以使用lib和dll文件而不包括标题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用lib和dll文件而不包含标题。



我需要使用dll或lib文件中的命名空间和类而不在include中添加标题我的项目。

is it possible to use lib and dll files without including headers.

I need to use namespace and classes from dll or lib files without adding headers in includes in my project .

推荐答案

是的。但是你必须处理头文件自己包含的所有必需定义,并且很有可能出错 - 此时你的应用程序将无法正常工作。
Yes. But you would have to handle all the required definitions that the header files contain yourself, and there is a good chance of getting something wrong - at which point your app will not work correctly.


那里你的问题中没有很多信息。可能有一种方法可以使用运行时动态链接调用dll中的方法:

http://stackoverflow.com/questions/554551/call-function-in-c-dll-without-header [ ^ ]



如果是lib:



http://stackoverflow.com/questions/11852329/linking-library-without-a-header-file [ ^ ]



但是为什么?使用这样的方法将难以维护。
There is not a lot of information in your question. There may be a way to call a method in a dll using runtime dynamic linking:
http://stackoverflow.com/questions/554551/call-function-in-c-dll-without-header[^]

In the case of a lib:

http://stackoverflow.com/questions/11852329/linking-library-without-a-header-file[^]

But why? Using an approach such as this will be difficult to maintain.


这篇关于是否可以使用lib和dll文件而不包括标题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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