0

I'm attempting to write a C program incorporating OPENFILENAME and of course I need the header file. So, following the instructions provided with tcc, I downloaded the header files MinGW uses for the Win32 API (and the library files) and put them in the appropriate directories as instructed. However, when I come to compile the program, I get the following error:

In file included from sw1.c:2:
c:/prg/tcc/include/winapi/commdlg.h:503: declaration list expected

This seems rather odd, given it's a standard header. So, I look up the line and it's typedef __AW(CHOOSECOLOR) CHOOSECOLOR,*LPCHOOSECOLOR;, which doesn't look very valid to me but then I'm not really a C expert and I've mainly been writing in Linux. I have no idea why it's going wrong though and no knowledge of how to fix it? Is it a bug in tcc?

As evidence that this should be possible, here is the appropriate passage from the tcc readme:

Header Files:


The system header files (except _mingw.h) are from the MinGW distribution:

http://www.mingw.org/

From the windows headers, only a minimal set is included. If you need more, get MinGW's "w32api" package.

I understand that this question is similar to Error when including Windows.h with TCC but my "windows.h" file does work - it's just this that doesn't.

Does anyone know how to solve this? I'm really at a loose end!

Community
  • 1
  • 1
DHeadshot
  • 43
  • 1
  • 4
  • You might want to look for that line causes the error in the question you linked in your working version of `winnt.h` file and see if it has be changed to work with tcc. – Ross Ridge Apr 15 '16 at 02:43
  • When you look at the [documentation](https://msdn.microsoft.com/en-us/library/windows/desktop/ms646839.aspx) it tells you which file declares a symbol, and which header file to include. Don't include *Commdlg.h*, include *Windows.h* instead. – IInspectable Apr 15 '16 at 07:50
  • @IInspectable I included windows.h _as well_. If I comment out the `#include `, I get the error: `sw1.c:50: 'OPENFILENAME' undeclared`. It _needs_ the header file, but won't compile with it! – DHeadshot Apr 15 '16 at 16:51

0 Answers0