Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Greetings & Kind Regards
I am attempting to utilize Visual Studio compiler via Tools :: Command Line :: Developer Command Prompt. The compiler is invoked via cl.exe w/ aguments directly copied from Visual Studio Project Properties :: C++ dialog box all shown below. Please note the "Command line warning"s in particular D9024 Apparently the double quotes around the /I option argument path are not sufficient though this is difficult to believe. I seek advice on how to solve or proceed otherwise. Thank You Kindly
cl.exe /JMC /permissive- /ifcOutput "x64\Debug\" /GS /W3 /Zc:wchar_t /I"C:\Program Files (x86)\Visual Leak Detector\include" /ZI /Gm- /Od /sdl /Fd"x64\Debug\vc143.pdb" /Zc:inline /fp:precise /D "_DEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /errorReport:prompt /WX- /Zc:forScope /RTC1 /std:c17 /Gd /MDd /std:c++20 /FC /Fa"x64\Debug\" /EHsc /nologo /Fo"x64\Debug\" /Fp"x64\Debug\IOWIU.pch" /diagnostics:column /c main.cpp
cl : Command line warning D9007 : '/JMC' requires '/Zi, /ZI or /Z7'; option ignored
cl : Command line warning D9024 : unrecognized source file type 'Files', object file assumed
cl : Command line warning D9024 : unrecognized source file type '(x86)\Visual', object file assumed
cl : Command line warning D9024 : unrecognized source file type 'Leak', object file assumed
cl : Command line warning D9024 : unrecognized source file type 'Detector\include /ZI /Gm- /Od /sdl /Fdx64\Debug\vc143.pdb /Zc:inline /fp:precise /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /errorReport:prompt /WX- /Zc:forScope /RTC1 /std:c17 /Gd /MDd /std:c++20 /FC /Fax64\Debug"', object file assumed
LINK : fatal error LNK1181: cannot open input file 'Files.obj'


What I have tried:

Reviewed all relevant Microsoft documentation re/ /I compiler option.
Posted
Updated 2-Dec-22 5:31am
Comments
Richard MacCutchan 2-Dec-22 11:23am    
There is nothing obviously wrong with what you have shown above. Did you type this in at the prompt, or use some other method to run it?
BernardIE5317 2-Dec-22 11:36am    
I typed cl.exe then pasted the long list of options then typed the final /c option then typed main.cpp then hit [Enter]. Further if a command file is utilized containing all the same above options and invoked as per cl @cl_cmd.txt the result is identical.
Richard MacCutchan 2-Dec-22 11:37am    
See below.

1 solution

I just tried this and it seems that the problem is the backslash characters in "x64\Debug\". When I changed it to "x64/Debug/" it worked OK. I was not aware that backslash changed the value of " in the command window. You should also check any other quoted strings ending in \".

See the explanation at Quotes, Escape Characters, Delimiters - Windows CMD - SS64.com[^].
 
Share this answer
 
v3
Comments
BernardIE5317 2-Dec-22 12:01pm    
Thanks a million
Richard MacCutchan 2-Dec-22 12:07pm    
Happy to help, and I learned something new today.
Dave Kreskowiak 2-Dec-22 15:01pm    
Nice catch

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900