Question

I am having issues compiling the decNumber http://speleotrove.com/decimal/, source is here http://download.icu-project.org/files/decNumber/decNumber-icu-368.zip (includes examples etc. that need to be deleted)

Has anyone compiled this successfully? Your comments will be much appreciated!!

The compiler issues an error as a result of the following directives:

#if !defined(QUAD)
#error decBasic.c must be included after decCommon.c
#endif

(This is a small section of code from decCommon.c and decBasic.c is another source file)

The author of the code states in comments that these 2 source files are shared. There are no corresponding .h files.

I am on Windows 7 64 bit, compiling with Visual Studio 2010 32 bit.

Thank you in advance for your help.

Was it helpful?

Solution

decBasic.c and decCommon.c are #included at the BOTTOM of the specific implementation files (such as decDouble.c). So - you shouldn't compile decBasic.c or decCommon.c, but treat them like header files.

If you look at the MAKE file included, you can see what the compilation targets are: decBasic and decCommon are missing.

If you are using Visual Studio, you can add decBasic.c and decCommon.c as headers, so they appear in the project but will not be compiled.

OTHER TIPS

decNumber is not in a compilable state in its original form as it requires some source code modifications to include standard integer types. QDecimal library handles this issue by using slightly modified version of decNumber. Please see QDecimal project for details:

http://code.google.com/p/qdecimal/

http://code.google.com/p/qdecimal/source/browse/doc/INSTALL.txt

When compiling with Visual Studio 2010 do not include decBasic.c and decCommmon.c to the project. These files are include-only and should not be compiled separately. In my case I am using decDouble module only and my project is setup as follows:

  • Header Files
    • decContext.h
    • decDouble.h
    • decDPD.h
    • decnumberlocal.h
    • decQuad.h
  • Source Files
    • decContext.c
    • decDouble.c
    • decQuad.c

Additionally files decBasic.c and decCommon.c are in the same directory where decQuad.c is located.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top