gpt4 book ai didi

c - 微型 C 编译器链接我的程序集目标文件

转载 作者:太空宇宙 更新时间:2023-11-04 03:51:35 25 4
gpt4 key购买 nike

是否可以在 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

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

最佳答案

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

关于c - 微型 C 编译器链接我的程序集目标文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20300000/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com