GCC linker can't find standard library?

前端 未结 4 2017
臣服心动
臣服心动 2020-11-27 22:29

I\'ve been developing a school project in XCode. The final product has to be submitted in source code with a makefile, so I wrote a makefile and to start compiling that way,

4条回答
  •  醉酒成梦
    2020-11-27 23:10

        gcc main.o StackList.o world.o Farm.o -g -o Project1
    

    What in this command line do you think tells gcc to link in the C++ standard library? There are no C++ files being linked. You haven't specified a language. And you invoke the compilter as gcc.

提交回复
热议问题