BeamMP / BeamMP-Server

Server for the multiplayer mod BeamMP for BeamNG.drive
https://beammp.com
GNU Affero General Public License v3.0
131 stars 54 forks source link

[Bug] MSVCP140.dll and / or VCRUNTIME140_1.dll errors #141

Open StanleyDudek opened 2 years ago

StanleyDudek commented 2 years ago

Fill out general information OS: Windows 7, unknown Windows-based VPS, unknown linux using wine BeamMP-Server Version: 3.1.0

Describe the bug Server owners upgrading from 3.0.2 to 3.1.0 are reporting these errors at server start.

image

image

image

Expected behavior Not that

Additional context Temporary fix for these so far has been https://aka.ms/vs/17/release/vc_redist.x64.exe

lionkor commented 2 years ago

Hi! I think I might have fixed it, who can I contact to test a fix?

StanleyDudek commented 2 years ago

Uhhh, I guess any server owner that newly reports the issue in the discord or forum, and who HASN'T already installed the VC redist as a fix?

lionkor commented 2 years ago

Okay, sounds good, thanks

lionkor commented 2 years ago

Doesn't work yet, help appreciated.

Anonymous-275 commented 2 years ago

only way to fix this is to build the server as static

lionkor commented 2 years ago

Yes, @Anonymous-275, I know - could you look at

https://github.com/BeamMP/BeamMP-Server/blob/rc-v3.1.1/CMakeLists.txt#L53

and the previous versions, because NONE of them worked. That is statically building, the issue isn't that I don't know that it's the fix, the issue is that it doesn't do it

Anonymous-275 commented 2 years ago

You need these lines https://github.com/BeamMP/BeamMP-Launcher/blob/master/CMakeLists.txt#L5-L7

lionkor commented 2 years ago

You need these lines https://github.com/BeamMP/BeamMP-Launcher/blob/master/CMakeLists.txt#L5-L7

Yes, I know, they were in the server - we just need a way to toggle them off. I went through multiple iterations: The first was to simply put the code you sent into an if(), but that didn't work (no clue why).

Those lines are they are in the launcher are NOT how you do it with modern CMake, which we use in the Server, and so I put those lines I linked to in my previous comment. That's how you pick whether to use /MT or /MD or any of the debug variants.

I'm specifically looking to fix the solution as it is, because it is supposed to do the SAME thing the launcher does in the link you sent.

This is documented in CMake's documentation, and this is the correct way to do it (the way we do it currently in the server, see my link). It just seems not to work, and I'd love to know why. I cannot afford a windows license, or afford the time to download a VM, or afford really any work associated with this, so I hoped we could get one of our 4 developers who actually ARE on windows to look into this.

We need /MT, and toggleable, basically.

lionkor commented 2 years ago

https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html

image

lionkor commented 2 years ago

image

lionkor commented 2 years ago

Maybe the vcpkg cmake is wildly out of date and doesn't support this? I wouldn't be surprised

Anonymous-275 commented 2 years ago

you need to have all the libraries from vcpkg be static as well but you need that flag to be always active since as soon as you need or want it to not be you will have to link to that DLL there is no other way sadly.

O1LER commented 11 months ago

Issue persists with v3.1.2

image

Please keep the note and link to the Visual C++ redistributable as with v3.1.1