I am trying to compile a source with tcc against a gcc-generated .o file, but it kept failing. The gcc is from MinGW 64 bit.
More specifically, I have the following two files (te1.c te2.c). I did the following commands on windows7 box
c:\tcc> gcc -c te1.c
c:\tcc> objcopy -O elf64-x86-64 te1.o
c:\tcc> tcc te2.c te1.o
(it produced te2.exe, when I ran it, windows OS generates an error saying "te2.exe has stopped working")
Any ideas?
Thanks!
========file te1.c=============
#include <stdio.h>
void dummy () {
printf("in dummy()\n");
}
========file te2.c===================
#include <stdio.h>
extern void dummy();
int main(int argc, char *argv[]) {
dummy();
return 0;
}