Hello everyone (else) on the floor. As the subject says I am getting some very, very strange compiler errors (g++ 3.4.4) when I include the misc.h header and try to use the Singleton class. If I remove the include and the oneline instantiation of a singleton class the unit compiles fine. This is what it looks like:
// Crypto++ headers #include <cryptopp/misc.h // Use these Crypto++ containers/algorithms using CryptoPP::Singleton; // Global variables defined in this unit DaemonConfig g_config = Singleton<DaemonConfig> ().Ref (); Now, DaemonConfig is a class (of mine) and instantiating it normall works fine and has done for months in many different ways (e.g. static, const, ptr, ref, heap, stack, global). When I try and use the Singleton class I get these compiler errors: ...src/DaemonConfig.cpp: In copy constructor `std::basic_ios<char, std::char_traits<char> >::basic_ios(const std::basic_ios<char, std::char_traits<char> >&)': /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/ios_base.h:781: error: `std::ios_base::ios_base(const std::ios_base&)' is private .../src/DaemonConfig.cpp:77: error: within this context .../src/DaemonConfig.cpp: In copy constructor `std::basic_filebuf<char, std::char_traits<char>
::basic_filebuf(const std::basic_filebuf<char, std::char_traits<char> &)':
/usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../include/c++/3.4.4/streambuf:769: error: `std::basic_streambuf<_CharT, _Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char, _Traits = std::char_traits<char>]' is private .../src/DaemonConfig.cpp:77: error: within this context gmake: *** [DaemonConfig.o] Error 1 What makes this really weird is that this class and it's parent has nothing to do with any std stream I/O classes! Even more strange is that the lines it gives (77) is in fact the last line of the file and contains no code! Anyone got any ideas what is going on here? I have tried taking the Singleton class (and it's dependencies) from misc.h and sticking in its own file to try and narrow the problem - same thing happens. Regards, Jim Vanns
