On 7 July 2012 19:59, mahdi hamzeh <mahdy.ham...@gmail.com> wrote:
> Hello,
>
> I am newbie in GCC plugin. I am developing a gcc plugin but I am
> struggled with a problem I could not figure out how to deal with. The
> problem is following:
>
> I use a function in the plugin which is defined and specified in a
> ".c" file. The function is "void loop_optimizer_init (unsigned flags)"
> and which is specified in "loop-init.c". To be able to use this
> function, I included "cfgloop.h" in which this function is defined as
> "extern void loop_optimizer_init (unsigned)". During compilation, I
> don't get any error but something goes wrong since at run-time, I
> receive "undefined symbol: loop_optimizer_init". I tried to compile my
> plugin with different optimization options (without O, -O2, -O3) but I
> still get this error. Can anybody please guide me or give me a
> reference to figure out how to solve this problem? I appreciate it.

You didn't say what version of GCC you're using, but the problem is
probably that on the SVN trunk GCC is compiled as C++, so
loop_optimizer_init is a C++ function and its name will be mangled as
_Z19loop_optimizer_initj

Reply via email to