0

I am running the LLVM's Kaleidoscope example which dynamically compiles and executes a program.

I added a call to library function (for example printf) in the compiled program and I keep getting the error:

LLVM ERROR: Program used external function 'printf' which could not be resolved

Tomasz Jakub Rup
  • 10,502
  • 7
  • 48
  • 49
revit
  • 361
  • 1
  • 3
  • 10
  • Possible duplicate of [LLVM JIT-compiled program cannot find external functions](http://stackoverflow.com/questions/21173414/llvm-jit-compiled-program-cannot-find-external-functions) – NoDataDumpNoContribution Dec 07 '15 at 12:02
  • Not sure it's the same problem as the error mentioned in the link is not caused by calling a function in standard library. In my case I see that the binary is correctly linked to the right library (ldd of the binary shows /lib64/libc.so.6 which contains printf). I was looking for some way to get the address of standard library function via dlsym and execute it in llvm. – revit Dec 07 '15 at 12:37

0 Answers0