Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C1356: unable to find mspdbcore.dll

I am trying to "compile without linking" a code meant to be used as multithreaded .dll in future. I am using VS 2019 for the same. Here is the command that I have used:

"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\bin\HostX64\x86\cl.exe" /c /MD "C:\SpiceOpus\bin\ifspec.c"

This returns the following response:

ifspec.c c1: fatal error C1356: unable to find mspdbcore.dll

This file is however present in the following 3 locations in my system as confirmed by using dir /s mspdbcore.dll :

A)

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE

B)

C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\bin\HostX64\x64

C)

Directory of C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\bin\HostX86\x86

Thus, I would like to know how to instruct the compiler for the presence of these files and then use them. I have tried using /l option for doing this as shown :

C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\bin\HostX64\x86\cl.exe" /c /MD /L "C:\SpiceOpus\bin\ifspec.c"

But it says :

cl : Command line warning D9002 : ignoring unknown option '/L'

Please feel free to correct / suggest an alternative path. Kindly consider me as layman in coding things. I am in EE with not much experience in these coding stuff. Thank You.

--------------------------- Regarding PATH-----------------

  1. Using SET command in developer cmd prompt showed this after installation for PATH variable:

Path=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\devinit;C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools;

  1. If one uses cl command in Administrator developer command prompt after this, it doesn't recognize it. However, if one uses the following code:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\bin\HostX86\x86\cl.exe"

This evokes the following response:

Microsoft (R) C/C++ Optimizing Compiler Version 19.20.27525 for x86 Copyright (C) Microsoft Corporation. All rights reserved. usage: cl [ option... ] filename... [ /link linkoption... ]

  1. I tried to use SET command to modify the PATH using
SET PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\bin\HostX86\x86\cl.exe;%PATH%

PATH gets modified but using cl command (in administrator developer cmd prompt of course ) again says that it's not recognized.

  1. I have already repaired the installation for BuildTools using its installer. cl.exe works for sure or how else do you get the response given in point 2,5. Please let me know why cl doesn't work but writing the command in point 2 gives results? Secondly, the modified PATH variable gets restored to the original one after every reboot. How do I avoid this?

  2. So in summary this is where I am stuck now: I have figured out that the following code seems to work partly :

"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\bin\HostX86\x86\cl.exe" /I "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.20.27508\include" /I "C:\SpiceOpus\source\include" "C:\SpiceOpus\bin\cfunc.c" /c /MD "C:\SpiceOpus\bin\cfunc.c"

But it just says it is generating code........ I can't find any object file from it.

like image 728
ontheshore Avatar asked Sep 03 '25 01:09

ontheshore


2 Answers

I got this error when trying to run dumpbin.exe from C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x86 with either the /HEADERS or /ALL flags on a 64 bit machine.

The fix was to cd C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64 and then dumpbin /HEADERS "c:\Program Files (x86)\PostgreSQL\10\pgAdmin 4\bin\libpq.dll" worked.

Since this was at the top of the search list for this error message, I wanted to report the fix.

like image 55
nachbar Avatar answered Sep 04 '25 15:09

nachbar


using Visual Studio Installer, you'll want to:

  1. Click "Modify" on your existing Visual Studio 2019/2022 install.
  2. Select "Individual Components" on the next screen
  3. In the search box, put in "2017"
  4. Check the box labeled "MSVC v141 - VS 2017 C++ x64/x86 Spectre-mitigated libs"
  5. click Install

enter image description here

After installation completes, you can re-run your cargo install or whatever gave you that error message and it should work. I didn't have to reboot or re-open a terminal/command prompt, it just worked once I installed.

like image 41
Matt Hargett Avatar answered Sep 04 '25 15:09

Matt Hargett