alecthomas / entityx

EntityX - A fast, type-safe C++ Entity-Component system
MIT License
2.23k stars 295 forks source link

Issue with install from vcpkg #245

Closed morphogencc closed 3 years ago

morphogencc commented 3 years ago

Hello --

I installed the package via vcpkg and ran into some problems.

When compiling in Debug I get the following errors:

Error   LNK2038 mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in BasicEntityExampleApp.obj BasicEntityExample  C:\Users\myProject\examples\BasicEntityExample\vc2013\entityx-d.lib(Event.cc.obj)   1   
Error   LNK2038 mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in BasicEntityExampleApp.obj BasicEntityExample  C:\Users\myProject\examples\BasicEntityExample\vc2013\entityx-d.lib(Pool.cc.obj)    1   
Error   LNK2038 mismatch detected for 'RuntimeLibrary': value 'MDd_DynamicDebug' doesn't match value 'MTd_StaticDebug' in BasicEntityExampleApp.obj BasicEntityExample  C:\Users\myProject\examples\BasicEntityExample\vc2013\entityx-d.lib(Entity.cc.obj)  1   
Error   LNK2005 "public: __cdecl std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QEAA@H@Z) already defined in libcpmtd.lib(xlock.obj)  BasicEntityExample  C:\Users\myProject\examples\BasicEntityExample\vc2013\msvcprtd.lib(MSVCP140D.dll)   1   
Error   LNK2005 "public: __cdecl std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QEAA@XZ) already defined in libcpmtd.lib(xlock.obj) BasicEntityExample  C:\Users\myProject\examples\BasicEntityExample\vc2013\msvcprtd.lib(MSVCP140D.dll)   1

When I try to compile in Release, I don't get the LNK2005 errors but still get the LNK2038 errors.

vcpkg only shows me a statically built version of the library, and my project is built for static linkage, so I can't figure out why it thinks there's a dynamic linkage going on. Is vcpkg somehow building the project with a dynamic build even though I'm asking for the dynamic library? Am I linking entityx wrong?

After building with vcpkg, I haven't added or configured anything in Visual Studio to use entityx.