function linked but not getting called.

  • Thread starter maaveerar_pingpong
  • Start date
M

maaveerar_pingpong

Hello all,

I am using GCC version 3.4.3 on a Linux 2.6 Kernel based machine.

I have a library of classes in an partially (incremenally?) built
object file, i.e. linked using -Ur option. I link this to a shared
library. One of classes in the object library, has an inline fuction
which is called from the shared lib as shown below. This inline
function All projects compile and link without errors.

class classA
{
map<string, object*>::table;
}

inline object* classA::getObject("key")
{
return table["key"];
}

Below function is in a shred lib calls the above in a partially linked
library.

classA foo;

object = foo.getObject();
object <- is null

Since the linker did not complain, I assumed the function was properly
inlined into the shared lib and everything is hunky dory. But it does
not seem so. When I step through, the line is executed however the
return value is always NULL. If I remove the inline and make it part of
the library, it correctly returns the object.

-thanks a bunch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top