[LLVMdev] Unresolveable fallthrough functions

Cédric Venet cedric.venet at laposte.net
Mon Sep 1 12:01:25 PDT 2008



> -----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





More information about the llvm-dev mailing list