1

Is it possible to link a *.o file generated with nasm in tcc?

With gcc it works fine for me:

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

When I try the same procedure with tcc, i got the following error: 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

Did i forget something in the compiling options?

  • maybe tcc's output file's format is not the same as the rest. Did you try linking an *.o file generated by tcc with a program in gcc? – phuclv Nov 30 '13 at 12:51
  • 1
    Off topic, I strongly suggest you use latest from http://repo.or.cz/w/tinycc.git , and make sure you use mob branch. tcc has very rare releases (once per few years sometimes), so the only way to benefit from updates is to roll your own. – mikijov Dec 01 '13 at 14:01

1 Answers1

1

Tcc does not handle -f win32. Use -f coff instead.

Zdeněk Pavlas
  • 357
  • 2
  • 5