-
Notifications
You must be signed in to change notification settings - Fork 342
fix the compilation errors of forecast package under windows 32bit
The error is caused by the compatibility problem between linux 64bit and windows 32bit.
The code itself has no problem. What we only need to do is to re-include some head files and add some options on g++ compiler:
(1) add the following lines into calcBATS.h
/////////////////////////////////////////
#define GXX_EXPERIMENTAL_CXX0X 1
#ifndef HAVE_ERRNO_T
typedef int errno_t;
#endif
#if __WORDSIZE == 64
# ifndef __intptr_t_defined
typedef long int intptr_t;
# define __intptr_t_defined
# endif
typedef unsigned long int uintptr_t;
#else
# ifndef __intptr_t_defined
typedef int intptr_t;
# define __intptr_t_defined
# endif
typedef unsigned int uintptr_t;
#endif
#include <inttypes.h>
#include <stdint.h>
#include <cstdint>
#include <errno.h>
#include <cstddef>
/////////////////////////////////////////////////
(2) add the following lines in /src/makevars.win:
PKG_CXXFLAGS=“-std=gnu++0x”
Then we would be able to pass the compilation in windows xp 32bit.
Note: I have not tested whether it is compilable in linux.…..