tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] tcc generated exe failed to work if it's linked with gcc


From: Jin Qian
Subject: [Tinycc-devel] tcc generated exe failed to work if it's linked with gcc generated object file
Date: Mon, 11 Jul 2016 03:37:03 +0000 (UTC)

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;
}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]