0

I'm receiving an error trying to build a program due to file mingw/include/math.h

The error states include/math.h:379:20: error: expected identifier or '(' before numeric constant

The error is from the following lines

extern int __cdecl __isnan (double);
extern int __cdecl __isnanf (float);
extern int __cdecl __isnanl (long double);

I'm wondering if I am able to modify these lines to work with my compiler or not, such as making them do the same thing in a compatible way, or what I need to do to fix these errors.

Just as importantly, I am also curious what these lines do.

If it is of any help, I am trying to do mingw32-make install freealut after configuring using cmake.

Thanks

Treyten Carey
  • 641
  • 7
  • 17
  • Are you sure these headers are intended for that compiler? – tadman Dec 13 '17 at 21:30
  • No I am not sure. I am following the article at https://wiki.haskell.org/ALUT, and I have made sure to do everything step-by-step. It doesn't state anything else on the topic. – Treyten Carey Dec 13 '17 at 21:35
  • Those are part of a standard library header. Don't mess with them. If your program will not compile but millions upon millions of other programs using the same header will, odds are very good the problem is at your end somewhere. That or your compiler installation got mangled somehow and should be repaired or reinstalled. Start by producing a [mcve]. If that doesn't help you spot and fix the error, edit your question to include the MVCE. – user4581301 Dec 13 '17 at 22:03
  • I agree it's on my end somewhere. I'm guessing it might have something to do with compiling under CXX. – Treyten Carey Dec 13 '17 at 22:11

1 Answers1

2

The lines each declare a function returning int, one takes double,one float and one long double. The

__cdecl is normally a calling convention indicator but I would check that it has not been #define'd to something else, other than that there is no numeric constant in that code.

SoronelHaetir
  • 14,104
  • 1
  • 12
  • 23
  • So the lines simply state that it takes a value (double, float, long double) and returns an int? I thought it would be more complex than that. Thank you. – Treyten Carey Dec 13 '17 at 21:34