I'm trying to compile decNumber++ using g++ on Linux. Unfortunately, I'm hitting compile errors due to the use of the forward-declared decimal32/64/128 classes in the extended_num_put/get templates:
% g++ --version
g++ (GCC) 4.1.2 20060928 (prerelease) (Ubuntu 4.1.1-13ubuntu5)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- From the "impl" directory:
% g++ -O2 -c -I.. -I/pub/apps/linux-i686/include *.cpp
../impl/decIO.h: In member function '_Iter std::decimal::extended_num_put<_CharT, _Iter>::put(_Iter, std::ios_base&, _CharT, std::decimal::decimal32) const':
../impl/decIO.h:138: error: '_V' has incomplete type
../impl/decCommon.h:54: error: forward declaration of 'struct std::decimal::decimal32'
../impl/decIO.h: In member function '_Iter std::decimal::extended_num_put<_CharT, _Iter>::put(_Iter, std::ios_base&, _CharT, std::decimal::decimal64) const':
../impl/decIO.h:141: error: '_V' has incomplete type
../impl/decCommon.h:55: error: forward declaration of 'struct std::decimal::decimal64'
../impl/decIO.h: In member function '_Iter std::decimal::extended_num_put<_CharT, _Iter>::put(_Iter, std::ios_base&, _CharT, std::decimal::decimal128) const':
../impl/decIO.h:144: error: '_V' has incomplete type
../impl/decCommon.h:56: error: forward declaration of 'struct std::decimal::decimal128'
../impl/decIO.h: In member function 'virtual _Iter std::decimal::extended_num_put<_CharT, _Iter>::do_put(_Iter, std::ios_base&, _CharT, std::decimal::decimal32) const':
../impl/decIO.h:171: error: '_V' has incomplete type
../impl/decCommon.h:54: error: forward declaration of 'struct std::decimal::decimal32'
../impl/decIO.h: In member function 'virtual _Iter std::decimal::extended_num_put<_CharT, _Iter>::do_put(_Iter, std::ios_base&, _CharT, std::decimal::decimal64) const':
../impl/decIO.h:177: error: '_V' has incomplete type
../impl/decCommon.h:55: error: forward declaration of 'struct std::decimal::decimal64'
../impl/decIO.h: In member function 'virtual _Iter std::decimal::extended_num_put<_CharT, _Iter>::do_put(_Iter, std::ios_base&, _CharT, std::decimal::decimal128) const':
../impl/decIO.h:183: error: '_V' has incomplete type
../impl/decCommon.h:56: error: forward declaration of 'struct std::decimal::decimal128'
../impl/decIO.h: At global scope:
../impl/decIO.h:565: warning: large integer implicitly truncated to unsigned type
../impl/decIO.h:565: warning: large integer implicitly truncated to unsigned type
../impl/decIO.h:565: warning: large integer implicitly truncated to unsigned type
../impl/decIO.h:565: warning: large integer implicitly truncated to unsigned type
../impl/decIO.h:565: warning: large integer implicitly truncated to unsigned type
../impl/decIO.h:565: warning: large integer implicitly truncated to unsigned type
../impl/decIO.h: In member function '_Iter std::decimal::extended_num_put<_CharT, _Iter>::put(_Iter, std::ios_base&, _CharT, std::decimal::decimal32) const':
../impl/decIO.h:138: error: '_V' has incomplete type
../impl/decCommon.h:54: error: forward declaration of 'struct std::decimal::decimal32'
../impl/decIO.h: In member function '_Iter std::decimal::extended_num_put<_CharT, _Iter>::put(_Iter, std::ios_base&, _CharT, std::decimal::decimal64) const':
../impl/decIO.h:141: error: '_V' has incomplete type
../impl/decCommon.h:55: error: forward declaration of 'struct std::decimal::decimal64'
../impl/decIO.h: In member function '_Iter std::decimal::extended_num_put<_CharT, _Iter>::put(_Iter, std::ios_base&, _CharT, std::decimal::decimal128) const':
../impl/decIO.h:144: error: '_V' has incomplete type
../impl/decCommon.h:56: error: forward declaration of 'struct std::decimal::decimal128'
../impl/decIO.h: In member function 'virtual _Iter std::decimal::extended_num_put<_CharT, _Iter>::do_put(_Iter, std::ios_base&, _CharT, std::decimal::decimal32) const':
../impl/decIO.h:171: error: '_V' has incomplete type
../impl/decCommon.h:54: error: forward declaration of 'struct std::decimal::decimal32'
../impl/decIO.h: In member function 'virtual _Iter std::decimal::extended_num_put<_CharT, _Iter>::do_put(_Iter, std::ios_base&, _CharT, std::decimal::decimal64) const':
../impl/decIO.h:177: error: '_V' has incomplete type
../impl/decCommon.h:55: error: forward declaration of 'struct std::decimal::decimal64'
../impl/decIO.h: In member function 'virtual _Iter std::decimal::extended_num_put<_CharT, _Iter>::do_put(_Iter, std::ios_base&, _CharT, std::decimal::decimal128) const':
../impl/decIO.h:183: error: '_V' has incomplete type
../impl/decCommon.h:56: error: forward declaration of 'struct std::decimal::decimal128'
../impl/decIO.h: At global scope:
../impl/decIO.h:565: warning: large integer implicitly truncated to unsigned type
../impl/decIO.h:565: warning: large integer implicitly truncated to unsigned type
../impl/decIO.h:565: warning: large integer implicitly truncated to unsigned type
../impl/decIO.h:565: warning: large integer implicitly truncated to unsigned type
../impl/decIO.h:565: warning: large integer implicitly truncated to unsigned type
../impl/decIO.h:565: warning: large integer implicitly truncated to unsigned type
The code compiles cleanly on g++ 3.3 and 3.4, but I'd prefer to use the 4.1.x series as that is what I am using for the rest of my applications.