Search code examples
ccl

How to create obj file using cl.exe


I have a header (.h) and a c (.c) file. How can I create an object .obj file using them in cl.exe ?


Solution

  • cl /Wall /Fo foo.obj foo.c 
    

    Explanation:

    /Wall enables more warnings. You want this!

    /Fo foo.obj creates an object file named foo.obj

    foo.c This is your input C file. It must #include "yourHeaderFile.h"