MSVCP140.dll is valid error

Just starting out? Need help? Post your questions and find answers here.
rfresh737
User
User
Posts: 19
Joined: Fri Aug 25, 2023 4:28 pm

MSVCP140.dll is valid error

Post by rfresh737 »

New PB user here. Trying to run my first simple program on my windows 10 PC and am getting this dialog message on start up:

"MSVCP140.dll is valid, but is for machine type other than current machine."

How do I fix this?

Thank you...
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: MSVCP140.dll is valid error

Post by Fred »

Which PB version do you use (x86, x64) ? Does the IDE launch ?
User avatar
jacdelad
Addict
Addict
Posts: 2031
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: MSVCP140.dll is valid error

Post by jacdelad »

What is your first simple program?
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
rfresh737
User
User
Posts: 19
Joined: Fri Aug 25, 2023 4:28 pm

Re: MSVCP140.dll is valid error

Post by rfresh737 »

I was just using the form builder and bringing up a blank window form.
rfresh737
User
User
Posts: 19
Joined: Fri Aug 25, 2023 4:28 pm

Re: MSVCP140.dll is valid error

Post by rfresh737 »

Yes, the IDE launches fine. x64 Windows 10.
rfresh737
User
User
Posts: 19
Joined: Fri Aug 25, 2023 4:28 pm

Re: MSVCP140.dll is valid error

Post by rfresh737 »

It looks like this is really a FAsm.exe 'machine type' mis-match error. Is there some place where I can change my machine type for FAsm.exe?
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: MSVCP140.dll is valid error

Post by Fred »

May be an antivirus issue. Why do you think it could be fasm ?
rfresh737
User
User
Posts: 19
Joined: Fri Aug 25, 2023 4:28 pm

Re: MSVCP140.dll is valid error

Post by rfresh737 »

I'm re-reading the dialog error again (below) and it's not FAsm.exe. It's a machine type mis-match within the 140.dll file. So does that mean the 140.dll file that I have for my windows 10 is a 32 bit version but I'm using a 64 bit windows 10 version?

(I turned off my anti-virus and it made no difference).

Image
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: MSVCP140.dll is valid error

Post by Fred »

Hum, FASM doesn't depends of MVCP140.dll but lld-link does. I have compiled another version of lld-link for PureBasic x64 without these dependencies dans also much smaller, could you give it a try ? (you need to replace it in the PureBasic\Compilers\ dir)

https://www.purebasic.com/beta/windows_x64/lld-link.exe
rfresh737
User
User
Posts: 19
Joined: Fri Aug 25, 2023 4:28 pm

Re: MSVCP140.dll is valid error

Post by rfresh737 »

I copied that file into PureBasic/Compilers folder and ran one of the example programs and got the same error dialog :(
rfresh737
User
User
Posts: 19
Joined: Fri Aug 25, 2023 4:28 pm

Re: MSVCP140.dll is valid error

Post by rfresh737 »

Doesn't that dialog message mean I have the wrong 140.dll file for my 64bit CPU?
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: MSVCP140.dll is valid error

Post by Fred »

We ship the correct version with the PB package, could you upload your DLL somewhere to see if it's the x86 version?
rfresh737
User
User
Posts: 19
Joined: Fri Aug 25, 2023 4:28 pm

Re: MSVCP140.dll is valid error

Post by rfresh737 »

So the .dll should be the x86 version?

Where do I upload the file to and how do I check if its x86?
rfresh737
User
User
Posts: 19
Joined: Fri Aug 25, 2023 4:28 pm

Re: MSVCP140.dll is valid error

Post by rfresh737 »

I checked the 140.dll file in the PureBasic\compilers folder and it's a 64 bit file.

Image
User avatar
ChrisR
Addict
Addict
Posts: 1484
Joined: Sun Jan 08, 2017 10:27 pm
Location: France

Re: MSVCP140.dll is valid error

Post by ChrisR »

Fred wrote: Fri Sep 06, 2024 1:55 pm Hum, FASM doesn't depends of MVCP140.dll but lld-link does. I have compiled another version of lld-link for PureBasic x64 without these dependencies dans also much smaller, could you give it a try ? (you need to replace it in the PureBasic\Compilers\ dir)
I tested the new lld-link and followed it up with procmon.
It does the job and looks very good :)
Really Much lighter (30 vs 84 Mb) and without the dependencies to msvcp140.dll, vcruntime140.dll, vcruntime140_1.dll

With this new version,I had no problems before with msvcp140.dll, but there shouldn't be any now, msvcp140.dll is no longer used at all.
The 3 dlls in the Compilers folder can be deleted (saved)
Post Reply