Guye Incognito
Guye Incognito

Reputation: 2844

How can I build a library as a .dll and not a .lib

I got this c++ physics library liquidfun

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?

EDIT: 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

Upvotes: 5

Views: 4634

Answers (2)

mkaes
mkaes

Reputation: 14119

The easiest way is to build your VS solution from cmake.
I don't have the parameter at hand right now but cmake can list the parameters for you.
I think it was -DBUILD_SHARED_LIBS

Upvotes: 2

Mr. Starck
Mr. Starck

Reputation: 232

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, not >LIB of course ;)

Upvotes: 2

Related Questions