如何将库构建为.dll而不是.lib [英] How can I build a library as a .dll and not a .lib

查看:63
本文介绍了如何将库构建为.dll而不是.lib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了这个c ++物理库 liquidfun

I got this c++ physics library liquidfun

他们提供了用于构建Windows库的Visual Studio解决方案.构建它时,它给我一个.lib,但我想要一个.dll,以便可以与Unity3d一起使用.有没有一种方法可以在Visual Studio中更改项目的构建设置以获取.dll而不是.lib?

Theyve included a visual studio solution for building the library for windows. When I build it it gives me a .lib but I want a .dll so I can use it with Unity3d. Is there a way of changing the build setting of a project in visual studio to get a .dll and not a .lib?

仅在项目属性中进行更改的非常简单的解决方法实际上对我有用!这可能是由于库本身编写得非常好.当我在发布此问题之前尝试相同的操作时,它不起作用,但这是由于我的c ++代码有问题

The very simple fix of just changing it in the project properties actually worked for me! This is probably due to the library itself being really well written. It didnt work when I tried the same thing before I posted this question but that was caused by a problem with my c++ code

推荐答案

是的,您可以生成一个dll而不是一个lib.要在VS中执行此操作,请右键单击您的项目->属性->配置属性->常规.在项目默认值"部分中,转到配置类型",然后将其更改为动态库.dll".然后不要忘记生成它;)

Yes, you can generate a dll instead of a lib. To do this in VS right click on your project -> properties -> Configuration Properties -> General. In the "Project default" section go to "Configuration Type" and change it to "dynamic library .dll". Then do not forget to generate it ;)

PS:DLL,而不是> LIB;)

PS : DLL, not >LIB of course ;)

这篇关于如何将库构建为.dll而不是.lib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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