Visual C ++命令行编译器(CL.EXE)重定向OBJ文件 [英] Visual C++ Command Line Compiler (CL.EXE) Redirect OBJ Files

查看:883
本文介绍了Visual C ++命令行编译器(CL.EXE)重定向OBJ文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编译器(CL.EXE)可以获取多个源文件,但喜欢生成它所调用的目录中的所有OBJ文件。我找不到编译器标志设置输出目录,但我发现一个单个OBJ,但它不能采取多个来源。

The compiler (CL.EXE) can take multiple source files, but likes to generate all the OBJ files in the directory that it is invoked. I couldn't find the compiler flag to set an output directory but I did find one for an individual OBJ, but it can't take multiple sources.

不必指定每个文件以重定向输出并具有NMAKE的许多目标,是否有通过CL做一个简单的方法?

Without having to specify each file to redirect the output and having lots of targets for NMAKE, is there an easy way to do it through CL?

推荐答案

事实证明, / Fo 选项实际上有效,但您指定的目录必须以反斜线结尾。因此

It turns out the /Fo option actually works, but the directory you specify must end with a backslash. Thus

cl  /Fo.\obj\  -c foo.c fee.c

有效,但 cl /Fo.\obj -c ...

这篇关于Visual C ++命令行编译器(CL.EXE)重定向OBJ文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆