由于缺少.lib文件,因此无法引用库项目(DLL) [英] Can't reference a library project (DLL) because .lib file is missing

查看:409
本文介绍了由于缺少.lib文件,因此无法引用库项目(DLL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试启动一个C ++游戏引擎项目.

I'm trying to start a C++ game engine project.

我对dll和lib的了解不多,但认为引擎本身将是dll,并且我将有单独的dll项目(例如渲染器,输入等)供引擎使用,而引擎dll将是游戏所用.

I don't have much knowledge of dll's and lib's but figured the engine itself would be a dll and I would have separate dll projects such as renderer, input, etc that would be used by the engine and the engine dll would be used by the game.

我似乎在demo.exe项目中很好地引用了引擎项目(通过添加引用并将路径添加到其他包含目录),但是当尝试在引擎dll项目中添加对渲染器dll项目的引用时,我正在得到:

I seem to have the engine project referenced fine in the demo.exe project(by adding a reference and adding the path to additional include directories) but when trying to add a reference to a renderer dll project in the engine dll project I'm getting:

错误LNK1104:无法打开文件'MyPath \ Renderer.lib'MyPath \ LINK 引擎

error LNK1104: cannot open file 'MyPath\Renderer.lib' MyPath\LINK Engine

为什么提到库?

推荐答案

许多DLL带有相应的LIB库,仅在链接阶段才需要.因此,基本上有两种类型的LIB库:

Many DLLs comes with corresponding LIB libraries, that are only needed at linking stage. So basically there are 2 types of LIB libraries:

  1. 包含所有目标文件的真实静态库

  1. Real static library that contains all the object files

仅具有链接程序定义的库,此类库附带DLL

Library with only definitions for the linker, this kind of libraries comes with DLLs

因此,基本上,您需要链接此LIB文件才能使用DLL

So basically you need to link this LIB file in order to be able to work with DLL

这篇关于由于缺少.lib文件,因此无法引用库项目(DLL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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