问题
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
回答1:
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 ;)
回答2:
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
来源:https://stackoverflow.com/questions/21407477/how-can-i-build-a-library-as-a-dll-and-not-a-lib