Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Tiny C编译器链接我的程序集对象文件_C_Assembly_Linker_Nasm_Tcc - Fatal编程技术网

Tiny C编译器链接我的程序集对象文件

Tiny C编译器链接我的程序集对象文件,c,assembly,linker,nasm,tcc,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

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

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

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

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

可能tcc的输出文件格式与其他文件不同。您是否尝试将tcc生成的*.o文件与gcc中的程序链接?在主题之外,我强烈建议您使用最新版本,并确保使用mob分支。tcc有非常罕见的版本(有时每隔几年发布一次),所以从更新中获益的唯一方法就是自己发布。也许tcc的输出文件的格式与其他版本不同。您是否尝试将tcc生成的*.o文件与gcc中的程序链接?在主题之外,我强烈建议您使用最新版本,并确保使用mob分支。tcc有非常罕见的版本(有时每隔几年发布一次),所以从更新中获益的唯一方法就是推出自己的版本。@user3052100可以用“-f elf”试试。@user3052100可以用“-f elf”试试吗。