On 04/26/2012 05:38 PM, Ilya Chernykh wrote:
Hi!
I encountered a completely strange link-time error after moving to gcc-47. The linker reports "undefined reference" but does not suggest any libraries that could include the function. Even more, the function seems to be a part of the same program. The compiling stage passes well.
This is the build log:
Here is the problem: simpleValueFromXpdfObj template is declared in src/kernel/cobjectsimple.h. This header file is included in the src/kernel/cobject2string.cc file and thus when this file gets compiled the compiler sees the declaration and knows everything it needs to know to be happy. However, the implementation of the template is in the file src/kernel/cobject2xpdf.cc. The result is that the compiler never sees the use and the implementation of the template at the same time and thus the template is never instantiated. No template instantiation => not entry in the object table. Therefore, when the linker gets around to stich everything together there is only the undefined symbol (location of the call) and no definition. Once you insert an instantiator into cobject2xpdf.cc the problem is resolved as the compiler will now instantiate the template and the linker can find the definition when stitching things together. You have a pending SR 115767 which fixes the error. Later, Robert -- Robert Schweikert MAY THE SOURCE BE WITH YOU SUSE-IBM Software Integration Center LINUX Tech Lead rjschwei@suse.com rschweik@ca.ibm.com 781-464-8147 -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org