[cfe-dev] clang doesn't compile simple code

fprijate prijatelj.francek at gmail.com
Tue Apr 29 11:47:08 PDT 2014


Hi

Here is a problem:
64bit clang with 64 bit mingw is OK, while 32bit clang is producing wrong
COFF.

Here is two liner:

---   test.c ---------------

#include <stdio.h>

void  __declspec(dllexport) hello(const char *s);

void hello(const char *s)
{
   printf("Hello %s\n", s);
}

---- build.bat  -----

clang -c  test.c  
gcc -shared -o test.dll test.o -Wl,--out-implib,test.a

Error from 32bit clang (64bit no error):
> Cannot export _hello: symbol not found
> collect2.exe: error: ld returned 1 exit status

I intentionaly use gcc -shared to show that the problem is in clang 
compiler (32bit)  producing a wrong test.o,
while 64bti version is ok ( wheter I use gcc -shared or clang -shared and
later link test.dll to main.c)

regards
FranĨek





--
View this message in context: http://clang-developers.42468.n3.nabble.com/clang-doesn-t-compile-simple-code-tp4038903p4039166.html
Sent from the Clang Developers mailing list archive at Nabble.com.




More information about the cfe-dev mailing list