0

I'm trying to install PDCurses for Windows using MinGW and CodeBlocks. I'm using this tutorial as I'm hopeless at installing things, so I need a straight-forward explanation. But when I run mingw32-make.exe, I get the build messages:

gcc -c -O2 -Wall -IC:\CodeBlocks\PDCurses-3.8 C:\CodeBlocks\PDCurses-3.8/pdcurses/addch.c
In file included from C:\CodeBlocks\PDCurses-3.8/curses.h:43,
                 from C:\CodeBlocks\PDCurses-3.8/curspriv.h:8,
                 from C:\CodeBlocks\PDCurses-3.8/pdcurses/addch.c:3:
C:/CodeBlocks/MinGW/lib/gcc/x86_64-w64-mingw32/8.1.0/include/stdarg.h:1:15: fatal error: stdarg.h: No such file or directory
 #include_next <stdarg.h>
               ^~~~~~~~~~
compilation terminated.
mingw32-make: *** [Makefile:98: addch.o] Error 1

I tried to move the PDCurses folder from D:\CodeBlocks to C:\CodeBlocks because that's where MinGW itself is located, but it didn't seem to work. I tried to build every other makefile instead (ones with .bbc, .vc and .wcc extensions) but I got the following error (which was honestly kind of expected since Makefile is the file you're supposed to use for GCC, which I use):

[name of makefile]:9: *** missing separator. Stop.

I also tried to comment out the line including stdarg.h, but then I got the same error for the next line, which included stddef.h. I tried to comment out that line as well but got an error on the next line including stdio.h, so the problem isn't specific to stdarg.h.

Please explain as simply as possible, as I'm not very used to makefiles or command prompt instructions.

Peter
  • 158
  • 1
  • 5
  • The makefile issue is most likely because you use spaces instead of tabs. The `make` program requires tabs. – Some programmer dude Mar 04 '23 at 13:11
  • @Someprogrammerdude If you're referring to the makefiles with different extensions, the manual told me not to use them since they're not for GCC, so I didn't really expect them to work. I don't quite understand where I was supposed to use tabs, though. I cannot use tabs in the command prompt, as far as I know. – Peter Mar 04 '23 at 13:23
  • 1
    Uninstall whatever versions of MinGW you have. Install [MSYS2](https://stackoverflow.com/q/30069830/2752075). Use it to install both GCC (see link) and Pdcurses (`pacman -S mingw-w64-ucrt-x86_64-pdcurses`). Then everything should just work, *and* you get a modern GCC (12.x instead of 8.x you have now). – HolyBlackCat Mar 04 '23 at 13:23
  • You're getting errors in your standard library, only incidentally because they were included from PDCurses -- it's not a PDCurses issue. It looks like a broken compiler installation. – William McBrine Mar 04 '23 at 13:41
  • In a makefile, commands for rules starts indented. These lines needs to be indented with a *tab* not with spaces. If the makefiles are from PDCurses then it's an error in PDCurses. If it's a makefile generated by Code:Blocks, then it's an error in Code:Blocks. If it's a makefile you created yourself, you need to make sure that tabs are not replaced by spaces. And use tabs to begin with. If the indented lines begin with space instead of tab, you get an error like the "missing separator" error you get. – Some programmer dude Mar 04 '23 at 13:51
  • @HolyBlackCat Thank you very much, it worked perfectly! I wished I could accept a comment as the best answer ... – Peter Mar 04 '23 at 13:55
  • Another thing to look out for are newline differences. More specifically differences between "Unix" and "Windows" newlines. – Some programmer dude Mar 04 '23 at 13:55

0 Answers0