<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>You are adding the symbol as "lle_X_create_number_object" yet your error message implies you have tried to lookup and use "create_number_object". Can you provide the code for the lookup?</div><br><div><div>On 20/08/2010, at 8:07 AM, Alec Benzer wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Is there documentation somewhere on how to call external functions from llvm? The only guide I found was this: <meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://www.gearleaf.com/blog/post/44">http://www.gearleaf.com/blog/post/44</a>, and it doesn't seem to be working for me.<div>

<br></div><div>I have a function:</div><div><br></div><div><div>llvm::GenericValue lle_X_create_number_object(llvm::FunctionType* ft, const std::vector<llvm::GenericValue>& args)</div><div>{</div><div>  llvm_object_structure* result = new llvm_object_structure;</div>

<div>  result->typeIdx = TypeSystem::number;</div><div>  result->data = reinterpret_cast<unsigned char*>(new double(args[0].DoubleVal));</div><div>  llvm::GenericValue gv;</div><div>  gv.PointerVal = reinterpret_cast<void*>(result);</div>

<div>  return gv;</div><div>}</div></div><div><br></div><div>defined in an extern "C" block. I add it as a symbol with: </div><div><br></div><div><div>llvm::sys::DynamicLibrary::AddSymbol("lle_X_create_number_object",(void*)lle_X_create_number_object);</div>

</div><div><br></div><div>yet when attempting to call it I still get: "LLVM ERROR: Program used external function 'create_number_object' which could not be resolved!"</div>
_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></body></html>