<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19154">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>Hello.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Adding this:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>#define WINVER 0x0500<BR>#define _WIN32_WINNT
0x0500</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>before include of <windows.h>
helped.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Thanks a lot.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2 face=Arial>P.S. I attached disassembled main.o, becuase I
don't know if the generated stuff is needed in that bc file.</FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px"
dir=ltr>
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=vanboxem.ruben@gmail.com href="mailto:vanboxem.ruben@gmail.com">Ruben
Van Boxem</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=hanzelpeter@gmail.com
href="mailto:hanzelpeter@gmail.com">Peter Hanzel</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Cc:</B> <A title=cfe-dev@cs.uiuc.edu
href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Friday, December 09, 2011 12:14
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [cfe-dev] LLVM/Clang Windows
XP 32bit - MessageBox</DIV>
<DIV><BR></DIV>
<P>Op 9 dec. 2011 11:48 schreef "Peter Hanzel" <<A
href="mailto:hanzelpeter@gmail.com">hanzelpeter@gmail.com</A>> het
volgende:<BR>><BR>> Hello.<BR>><BR>> I have downloaded CLANG 3.0
and successfuly build on Windows XP.<BR>> Now I tried to compile this
simple MessageBox Win32 Api program:<BR>><BR>> #include
<windows.h><BR>><BR>> int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {<BR>>
MessageBox(NULL, "hello msgbox world\n", "Title", MB_OK);<BR>> return
0;<BR>> }<BR>><BR>> I did it this way:<BR>><BR>> clang -c
-emit-llvm main.c<BR>> llc -filetype obj main.o -o test.obj<BR>> link
test.obj user32.lib msvcrt.lib<BR>><BR>> But when I run test.exe I get :
The procedure entry point InterlockedCompareExchange64 could not be located in
dynamic link library KERNEL32.dll.<BR>><BR>> So I dissassembled main.o
and there is usage of: (attached to mail)<BR>><BR>> declare dllimport
x86_stdcallcc i64 @InterlockedCompareExchange64(i64*, i64,
i64)<BR>><BR>> But I think this is valid only for 64bit or Vista and
more.<BR>> So I deleted whole stuff which is not needed to compile
it.<BR>> Then with:<BR>><BR>> llvm-dis main.o<BR>> edit main.o.ll
--remove 64bit stuff<BR>> llvm-as main.o.ll -o main.o<BR>> llc -filetype
obj main.o -o test.obj<BR>> link test.obj user32.lib
msvcrt.lib<BR>><BR>> And I got valid test.exe application, which also
works.<BR>><BR>> So my question is: Is this Adding of unwanted stuff
correct or is it some kind of bug?</P>
<P>Did you define the winver macro correctly? Does the problem still occur
then?</P>
<P>Ruben<BR>><BR>> Peter.<BR>><BR>><BR>>
_______________________________________________<BR>> cfe-dev mailing
list<BR>> <A
href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</A><BR>> <A
href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</A><BR>><BR></P></BLOCKQUOTE></BODY></HTML>