<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<div class="moz-text-html" lang="x-western">
I am using LLVM 2.5 release, together with llvm-gcc4.2-2.5.<br>
For the hello.c demo testing found close to the end of the
GettingStarted document:<br>
<br>
#include <stdio.h><br>
<br>
int main() {<br>
  printf("hello world\n");<br>
  return 0;<br>
}<br>
<br>
Following the instructions:<br>
obtaining the bc file:    <i>llvm-gcc -O3 -emit-llvm hello.c -c -o
hello.bc</i><br>
running through lli:     <b>  </b><i>lli hello.bc</i><br>
<br>
I got this error msg:    <i><b>ERROR: Program used external function
'puts' which could not be resolved! Abort</b></i><br>
<br>
I think this might have to do with my LD_LIBRARY_PATH settings, thus
explicitly checked that it includes a path to libc,<br>
echo $LD_LIBRARY_PATH:    <b><i>/lib:/usr/lib:/opt/llvm-2.5/lib:.:/home/czhao/suif/suif_1.3.0/i686-cygwin-cygwin/solib/</i></b><br>
<br>
<br>
How could I fix this WinXP/Cygwin only thing?<br>
<br>
I tried the same steps on a Debian4-i386 machine, everything works fine.<br>
<br>
<br>
Thank you very much<br>
<br>
Chuck<br>
<br>
<br>
Env:<br>
WinXP/Cygwin/LLVM-2.5/LLVMGCC4.2-2.5<br>
<br>
The bc code of the hello.c file:<br>
llvm-dis < hello.bc:<br>
<br>
; ModuleID = '<stdin>'<br>
target datalayout =
"e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32"<br>
target triple = "i386-mingw32"<br>
@.str = internal constant [13 x i8] c"Hello, world\00"        ; <[13
x i8]*> [#uses=1]<br>
<br>
define i32 @main() nounwind {<br>
entry:<br>
    %0 = tail call i32 @puts(i8* getelementptr ([13 x i8]* @.str, i32
0, i32 0)) nounwind        ; <i32> [#uses=0]<br>
    ret i32 0<br>
}<br>
<br>
declare i32 @puts(i8*)<br>
<br>
<br>
<br>
<br>
<br>
</div>
</body>
</html>