Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
说我有a.o并且b.o我想将它们组合成c.o
a.o
b.o
c.o
在makefilw中我写道:
gcc a.o b.o -o c.o
但得到了错误:
undefined reference to `main'
为什么会发生这种情况,正确的解决方案是什么?
我相信您正在尝试创建(静态)库或存档。例如在http://www.adp-gmbh.ch/cpp/gcc/create_lib.html或尝试输入man ar你的 shell :)
man ar