How can I compile C code that has already been C pre-processed with GCC?

前端 未结 3 516
心在旅途
心在旅途 2021-01-15 16:04

I\'m performing some source processing between C preprocessing and C compilation. At the moment I:

  1. gcc -E file.c > preprocessed_file.c.
3条回答
  •  醉话见心
    2021-01-15 16:52

    Looks like a typo in the GCC docs - try '-x cpp-output' instead.

    gcc -E helloworld.c > cppout
    gcc -x cpp-output cppout -o hw
    ./hw
    Hello, world!
    

提交回复
热议问题