Tiny C Compiler链接我的程序集目标文件

时间:2013-11-30 12:03:09

标签: c assembly linker nasm tcc

是否可以在tcc中链接用nasm生成的* .o文件?

使用gcc它对我来说很好:

nasm -f win32 -o fastmath.o fastmath.asm
gcc -o powerTest.exe powerTest.cpp cexport.o

当我使用tcc尝试相同的过程时,我收到以下错误:fastmath.o:1:错误:无法识别的文件

set name=test
set tccpath=C:\TCC\
set nasmpath=C:\NASM\

%nasmpath%nasm -f win32 -o fastmath.o fastmath.asm

%tccpath%tcc -c main.c
%tccpath%tcc -vv -luser32 -lgdi32 -lopengl32 -lglu32 -o %name%.exe main.o fastmath.o

我是否忘记了编译选项中的某些内容?

1 个答案:

答案 0 :(得分:1)

Tcc不处理-f win32。请改用-f coff。