<p style="margin:0;padding:0;" align="left"> Hello,<br /><br />I wrote a very simple openGL application, as below<br /><br />#include <stdio.h> <br />#include <GL/glut.h><br />int main(int argc, char **argv)<br />{<br />  glutInit(&argc, argv);<br />  glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);<br />  glutCreateWindow("red 3D lighted cube");<br />  printf("GL_VERSION = %s\n",glGetString(GL_VERSION) ); <br />  return 0;<br />}<br /><br />Compiling it with Clang and adding -lglut option worked correctly<br />$ clang  simple.c  -o  simple  -lglut<br />$ ./simple<br />GL_VERSION = 2.1 Mesa 7.10.2<br /><br />But, adding the -emit-llvm option to clang, does not work as below<br />$ clang -O3 -emit-llvm simple.c  -o simple.bc -lglut<br />/usr/bin/ld: /usr/local/bin/../lib/LLVMgold.so: error loading plugin<br />/usr/bin/ld: /usr/local/bin/../lib/LLVMgold.so: error in plugin cleanup (ignored)<br />clang: error: linker command failed with exit code 1 (use -v to see invocation)<br /><br />Also, removing the -lglut option worked with clang but failed with lli as below<br />$ clang -O3 -emit-llvm simple.c -c -o simple.bc<br />$ lli simple.bc<br />LLVM ERROR: Program used external function 'glutInit' which could not be resolved!<br /><br />Please advice how to run it using the llvm jit 'lli'<br /><br />Thanks in advance<br />Sara<br /><br /></p><BR><BR><a target=_blank href=http://www.laposte.net/Archiver/index.jsp><img style="margin: 0pt;" src="http://webmail.laposte.net/webmail/fr_FR/panels/images/Pied_de_Mail_DGP.gif" alt=""><a>