What does the “undefined reference to varName” in C mean?

后端 未结 6 1601
粉色の甜心
粉色の甜心 2020-12-01 18:32

I have 2 files: a.c and b.c

In a.c I am sending a signal to a function located in b.c

signal(SIGU         


        
6条回答
  •  余生分开走
    2020-12-01 18:58

    You need to compile and then link the object files like this:

    gcc -c a.c  
    gcc -c b.c  
    gcc a.o b.o -o prog  
    

提交回复
热议问题