Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is -o a candidate for deletion from the Microsoft compiler and linker?

I came across the following, and I am wondering what implications it is going to have on my Cygwin/GNU environment. Should I be using something other than -o to name the output from a compile?

Has there been some new standard adopted and do other compilers adhere to it?

What would be the motivation for removing -o?

DOS PROMPT> type compile.bat

cl.exe -D YY_MAIN=1 lex.yy.c libfl.obj -o foobar

DOS PROMPT> compile

cl.exe -D YY_MAIN=1 lex.yy.c libfl.obj -o foobar
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.
lex.yy.c
Microsoft (R) Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation.  All rights reserved.
/out:lex.yy.exe
/out:foobar.exe
lex.yy.obj
libfl.obj

cl: Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release


As the answer below asks, Are they trying to make more of a rift between Windows and UNIX intentionally? I hope not. I am hoping I am missing some new convention adopted by all the compilers out there.

like image 964
ojblass Avatar asked Apr 05 '09 23:04

ojblass


1 Answers

Yes. You should use /F to set compiler output options.

like image 162
i_am_jorf Avatar answered Nov 12 '22 07:11

i_am_jorf