undefined reference to main issue

后端 未结 3 1724
感动是毒
感动是毒 2021-01-22 20:03

I have written a c code file called \"utilfunc.c\" this code contains my functions that I will use through my code.

Now when I am compiling my \"utilfunc.c\" file an

3条回答
  •  悲&欢浪女
    2021-01-22 20:39

    Add -c to your compiler invocation, so that you only compile the translation unit but do not link it to a complete program:

    gcc -c -o foo.o foo.c
    

提交回复
热议问题