如何在没有crt的情况下链接obj文件?

问题描述 投票:-1回答:1

如何在没有CRT的情况下实现链接2 .o文件。

编译.c文件:

gcc -ffreestanding -c file.c -o file.o

链接:

gcc  file1.o file2.o -o f.o

标志-nostartfiles和-nostdlib对我没有帮助。

c++ c gcc linker crt
1个回答
0
投票

我只是编译2 .c文件,我想链接他们的1个目标文件

ld -r -o f.o file1.o file2.o
© www.soinside.com 2019 - 2024. All rights reserved.