I use Code::Blocks as my IDE on Windows, which uses MinGW as its compiler. My project has several Windows resource files that it doesn’t like, and the compiler refuses to tell me why. The message “syntax error” is really unhelpful.
Meanwhile, MSVC doesn’t have a problem with my resource files. Unfortunately, I can’t copy the resulting .res files to my project, because MinGW doesn’t recognise their format.
Through commenting and uncommenting, I’ve deduced that it has a problem with every CONTROL definition. Here’s the shortest resource file I have that has the problem:
#include "..winresource.h"
IDD_THANKSFORPLAYING DIALOG 0, 0, 254, 196
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "SONIC & KNUCKLES COLLECTION Trial"
LANGUAGE LANG_JAPANESE, 0x1
FONT 9, "MS Pゴシック"
BEGIN
CONTROL "", ID_THANKYOUFORPLAYING_MESSAGE, LISTBOX, LBS_NOTIFY | LBS_NOINTEGRALHEIGHT | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL | WS_HSCROLL, 7, 7, 240, 160
CONTROL "OK", ID_THANKSFORPLAYING_OK, BUTTON, BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 102, 175, 50, 14
END
For reference, I’ve tried replacing BEGIN and END with brackets, as I know some compilers have a preference, but that didn’t change anything. I also considered that the resource ID might not be replaced, but replacing it with a number doesn’t do anything either.
Does anyone have any idea why MinGW refuses it?