Stream: Coq users

Topic: ✔ [Newbie] Problem with clightgen.exe


view this post on Zulip Lessness (Jul 28 2021 at 17:09):

I wrote this c file:

#include <stddef.h>

// Sum of d, d*2, d*3, ... d*n
unsigned int aux(unsigned int d, unsigned int n) {
  return n*(n+1)/2*d;
}

// Sum of multiples of 3 or 5 less or equal to max
unsigned int solution(unsigned int max) {
  return aux(3, max/3) + aux(5, max/5) - aux(15, max/15);
}

int main(void) {
  unsigned int result;
  result = solution(999);
  return result;
}

Then I tried to use clightgen.exe on it, but got such error:

> clightgen.exe .\EulerProject1.c
In file included from C:/Program Files/Haskell Platform/8.6.5/mingw/x86_64-w64-mingw32/include/_mingw.h:275:0,
                 from C:/Program Files/Haskell Platform/8.6.5/mingw/x86_64-w64-mingw32/include/crtdefs.h:10,
                 from C:/Program Files/Haskell Platform/8.6.5/mingw/x86_64-w64-mingw32/include/stddef.h:7,
                 from C:/Program Files/Haskell Platform/8.6.5/mingw/lib/gcc/x86_64-w64-mingw32/7.2.0/include/stddef.h:1,
                 from .\\EulerProject1.c:1:
C:/Program Files/Haskell Platform/8.6.5/mingw/x86_64-w64-mingw32/include/vadefs.h:35:2: error: #error VARARGS not implemented for this compiler
 #error VARARGS not implemented for this compiler
  ^~~~~
ccomp: error: preprocessor command failed with exit code 1 (use -v to see invocation)

What am I doing wrong? Thanks!

view this post on Zulip Lessness (Jul 29 2021 at 11:37):

Solved the problem. Uninstalled Haskell Platform and reinstalled Cygwin, this time with C compiler.

view this post on Zulip Notification Bot (Jul 29 2021 at 15:31):

Lessness has marked this topic as resolved.


Last updated: Sep 30 2023 at 06:01 UTC