Hello,> ready> ERROR: Program used external function 'putchard' which could not be > resolved! > Any idea of what could be wrong?Please make sure you're using C linkage for such functions, due to mangling the name of function being emitted is not "putchard". Something like this: extern "C" void putchard(char c) { ... } Or, just provide a mapping by hands (if you're on platform without dynamic linking, e.g. on windows) -- WBR, Anton Korobeynikov
Anton Korobeynikov wrote:> > Hello, > >> ready> ERROR: Program used external function 'putchard' which could not >> be >> resolved! >> Any idea of what could be wrong? > Please make sure you're using C linkage for such functions, due to > mangling the name of > function being emitted is not "putchard". Something like this: > > extern "C" void putchard(char c) { > ... > } > > Or, just provide a mapping by hands (if you're on platform without dynamic > linking, e.g. on > windows) >Thanks for the reply. I'm on Linux and the function is extern'd: extern "C" double putchard(double X) { putchar((char)X); return 0; } Using the sin(x) and cos(x) functions work though, only the ones included in the main file don't. So I'm a bit puzzled... Thanks, Matthieu -- View this message in context: http://www.nabble.com/Unresolveable-fallthrough-functions-tp19249293p19258704.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
> -----Message d'origine----- > De : llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] > De la part de mriou > Envoyé : lundi 1 septembre 2008 20:18 > À : llvmdev at cs.uiuc.edu > Objet : Re: [LLVMdev] Unresolveable fallthrough functions > > > > > Anton Korobeynikov wrote: > > > > Hello, > > > >> ready> ERROR: Program used external function 'putchard' which could > not > >> be > >> resolved! > >> Any idea of what could be wrong? > > Please make sure you're using C linkage for such functions, due to > > mangling the name of > > function being emitted is not "putchard". Something like this: > > > > extern "C" void putchard(char c) { > > ... > > } > > > > Or, just provide a mapping by hands (if you're on platform without > dynamic > > linking, e.g. on > > windows) > > > > Thanks for the reply. I'm on Linux and the function is extern'd: > > extern "C" double putchard(double X) { > putchar((char)X); > return 0; > } > > Using the sin(x) and cos(x) functions work though, only the ones > included in > the main file don't. So I'm a bit puzzled... > > Thanks, > Matthieu >If you don't use the function anywhere, the compiler may/will strip it off (or if the compiler can 'understand' that the function is never called). It may be the problem. Just my 2cents Cédric
mriou wrote:> Using the sin(x) and cos(x) functions work though, only the ones included in > the main file don't. So I'm a bit puzzled...Did you link your executable with -rdynamic? -- Dr. Albert Gr"af Dept. of Music-Informatics, University of Mainz, Germany Email: Dr.Graef at t-online.de, ag at muwiinfa.geschichte.uni-mainz.de WWW: http://www.musikinformatik.uni-mainz.de/ag