I can't believe that I spent around 6 hours to debug this error code. Though I am just beginning with C++, its too long a time. I greped over the internet and the root cause as mentioned is
"this linker error will occur when a virtual function is not defined". I checked my class definition over and over and made very sure the all the virtual functions are defined in the base class. huhh i did that and this and was running out of options. tried sample programs and all went fine.
Then i took deep breath and was rolling over other files in the codebase and '#pragma interface" seemed to be something new to me. I tried googling it and found something interesting with gcc. Looks like the compiler will cache auxillary information and during the linking time, this cached information is used. In my case, the cached information may not have been the correct one. When we use this pragma, it forces gcc not to do any caching and hence force 'ld' to do the linking dynamically.
and this has done the trick for me.
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment