How to output preprocessed code AND compile it (Visual Studio)

前端 未结 3 1342
小鲜肉
小鲜肉 2021-02-15 17:27

I\'m generating preprocessor output (.i) from Visual Studio, but also want to do the actual build. Is there a combination of flags that will both output the .i file without then

3条回答
  •  走了就别回头了
    2021-02-15 17:35

    Use the switch /P Example- cl /C sample.c

    The above will generate a .I file with same name (sample.I). Now to compile the .I file, just rename .I file to .C then do cl /c to compile and generate an object file.

提交回复
热议问题