Compile multiple C source fles into a unique object file

后端 未结 7 1665
再見小時候
再見小時候 2020-12-13 10:48

I have some C source files and I am using gcc. I basically want to compile all of them and create one single object file. When I try:

gcc -c src         


        
7条回答
  •  感动是毒
    2020-12-13 11:31

    Either you make a final.c which will include all .c files then you can compile this final using gcc -c final.c command.

    or

    Another method is to use archive.Build all files to get respective .o then archive then in one library which will have all those .o file.

提交回复
热议问题