C Linking Error: undefined reference to 'main'

前端 未结 4 1594
走了就别回头了
走了就别回头了 2021-02-06 22:50

I have read the other answers on this topic, and unfortunately they have not helped me. I am attempting to link several c programs together, and I am getting an error in respons

4条回答
  •  死守一世寂寞
    2021-02-06 23:23

    You're not including the C file that contains main() when compiling, so the linker isn't seeing it.

    You need to add it:

    $ gcc -o runexp runexp.c scd.o data_proc.o -lm -fopenmp
    

提交回复
热议问题