Re: Linking issue while using C++ Templates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Rajat,

> File x.cpp compiles perfactly, but while linking it throws error saying,
> x.o(.gnu.linkonce.t._ZN9AI11BE11getInstanceEv+0x9): In function
> `A<B>::getInstance()':
> A.h:: undefined reference to `A<B>::_instance'
> collect2: ld returned 1 exit status
> 
> Any clue ?

You have declared A<B>::_instance in A.h.

But in which file have you defined A<B>::_instance?

HTH,
--Eljay



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux