1

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

使用 gcc 对我来说效果很好:

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

当我使用 tcc 尝试相同的过程时,出现以下错误:fastmath.o:1: error: unrecognized file

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

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

4

1 回答 1

1

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

于 2013-11-30T13:30:12.910 回答