Search code examples
cpowershellvisual-studio-codec-preprocessor

How to call preprocessor in c


I've been trying to call the preprocessor to create a .i file from a .c file using the cpp.exe preprocessor file.

When using this command: cpp file.c > file.i, this is what is shown at the terminal:

cmdlet Copy-ItemProperty at command pipeline position 1
Supply values for the following parameters:
Name:
Destination:
Copy-ItemProperty : Cannot bind argument to parameter 'Name' because it is an empty string.
At line:1 char:1
+ cpp file.c > file.i
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Copy-ItemProperty], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.CopyItemPropertyCommand

where it is required to input a string the after name and destination. What should I do in this case?


Solution

  • You are mistakenly calling cpp, the alias for the Powershell cmdlet Copy-ItemProperty, instead of cpp.exe.

    Use cpp.exe file.c > file.i instead.