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-----------------
- 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;
- 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... ]
- 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.
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?
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.
