PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, June 25, 2022

[FIXED] How do I customize the .exe filename for Microsoft cmdline compiler, cl?

 June 25, 2022     compiler-errors, filenames, output, rename, visual-studio     No comments   

Issue

The only two options that I was able to find from googling are /OUT and /Fe, but neither works for me:

Using /Fe shows no error but no output file found in the current dir either:

C:\hands_on\C>cl /Fe:test.exe main.c
Microsoft (R) C/C++ Optimizing Compiler Version 15.00.30729.01 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

main.c
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

/out::test.exe
main.obj

C:\hands_on\C>ls
main.c  main.obj

Using /OUT gives errors:

C:\hands_on\C>cl /OUT:test.exe main.c
Microsoft (R) C/C++ Optimizing Compiler Version 15.00.30729.01 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9025 : overriding '/Ot' with '/Os'
cl : Command line warning D9025 : overriding '/Os' with '/Ot'
cl : Command line warning D9002 : ignoring unknown option '/OU'
cl : Command line warning D9002 : ignoring unknown option '/OT'
cl : Command line warning D9002 : ignoring unknown option '/O:'
cl : Command line warning D9002 : ignoring unknown option '/Oe'
cl : Command line warning D9002 : ignoring unknown option '/O.'
cl : Command line warning D9002 : ignoring unknown option '/Oe'
cl : Command line warning D9002 : ignoring unknown option '/Oe'
main.c
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:main.exe
main.obj

The version of the compiler:

C:\hands_on\C>cl
Microsoft (R) C/C++ Optimizing Compiler Version 15.00.30729.01 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

Solution

The syntax is:

cl /Fetest.exe main.c

with no space or punctuation, or:

cl /Fe: test.exe main.c

with a colon and space.

You have a colon but no space:

cl /Fe:test.exe main.c

Source



Answered By - ChrisF
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing