This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Problems with <decimal/decimal> header on OS X
- From: Oleg Endo <oleg dot endo at t-online dot de>
- To: fpiro07 <fpiro07 at hotmail dot it>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Sun, 06 Jan 2013 14:15:15 +0100
- Subject: Re: Problems with <decimal/decimal> header on OS X
- References: <1357472724904-902209.post@n5.nabble.com>
On Sun, 2013-01-06 at 03:45 -0800, fpiro07 wrote:
> Hi everybody, I'm experiencing problems with the <decimal/decimal> C++ header
> on OS X.
>
> I've installed GCC 4.7.2 with MacPorts and it seems to work with normal
> programs but if I write a program which includes <decimal/decimal> I get a
> mile-long error message.
>
> E.G. I write in "main.cpp":
>
> #include <iostream>
> #include <decimal/decimal>
>
> using namespace std;
>
> int main()
> {
> cout << "Hello, world!" << endl;
>
> return 0;
> }
>
> and then in the shell:
>
> $ g++ main.cpp -o exe
>
> I get this error message:
>
> In file included from main.cpp:2:0:
> /opt/local/include/gcc47/c++/decimal/decimal:39:2: error: #error This file
> requires compiler and library support for ISO/IEC TR 24733 that is currently
> not available.
> [...]
>
> What does this mean? How can I make it work?
>
Maybe GCC was configured with '--disable-decimal-float'? You can check
how GCC was configured with 'g++ -v'.
If fixing the compiler is not an option for you, you can also try to use
a separate library, for example
https://github.com/hypnocode/decnumberxx
Cheers,
Oleg