C Linking Error: undefined reference to 'main'

前端 未结 4 1588
走了就别回头了
走了就别回头了 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:14

    You are overwriting your object file runexp.o by running this command :

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

    In fact, the -o is for the output file. You need to run :

    gcc -o runexp.out runexp.o scd.o data_proc.o -lm -fopenmp
    

    runexp.out will be you binary file.

提交回复
热议问题