From: Todd V. <tve...@ex...> - 1999-12-17 20:28:54
|
Hi Volker, Volker Dobler P945 <vol...@un...> wrote: > I am using blitz heavily in a larger project wich is > split into several source files. I have a main source file > where several global arrays are defined like > > Array<double,1> T(initial_Array_size); > > In the other source files these are declared like > > extern Array<double,1> T; > > Everything worked fine until we installed a new version > of egcs: gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release) > Every source file still compiles fine, but during linking I get > several of the following error messages: > > io.o: warning: multiple common of `blitz::MemoryBlockReference<double>::nullBlock_' > annealing.o: warning: previous common is here > io.o: warning: multiple common of `__sn_Q25blitzt20MemoryBlockReference1Zd.nullBlock_' > annealing.o: warning: previous common is here > init.o: warning: multiple common of `blitz::MemoryBlock<double> type_info node' > annealing.o: warning: previous common is here > > What's going wrong? > Am I making a stupid C++ error so that the templates get instantiated > multiple times, or is this a known problem with this version of egcs? Here's the situation: blitz::Array inherits from a class blitz::memoryBlockReference<T>. That class requires that a global static object blitz::MemoryBlock<T> MemoryBlockReference<T>::nullBlock_; be instantiated. It looks like gcc is instantiating this object multiple times, then the linker is warning you about these duplicate instances. I don't think these warnings are anything to worry about. You might check if there is a flag to suppress them. Also, if anyone has suggestions for dealing with static global template instances, please let me know. Cheers, Todd -- Todd Veldhuizen tve...@ac... Indiana Univ. Comp. Sci. http://extreme.indiana.edu/~tveldhui/ --------------------- blitz-support list -------------------------------- * To subscribe/unsubscribe: use the handy web form at http://oonumerics.org/blitz/lists.html |