windres

2008-05-13
2013-06-06
  • I'm having problems where windres isn't honouring system headers.  For example I have in a local included file ("resource.h"):

    #include <winver.h>
    #include <winuser.h>
    #include <commctrl.h>

    #define IDD_SHUTDOWN            100
    #define IDC_STATIC              101

    #define IDC_LOGO                200
    #define IDC_METHOD              201

    #define IDB_LOGO                1000

    I'm getting syntax errors from windres because SS_BITMAP isn't defined, despite it being in winuser.h.  I've tried adding '-I<MinGW64 system include dir>' but it didn't help.

     
    • NightStrike
      NightStrike
      2008-05-13

      What is your host system?

      Can you use the -v option and post the entire output, including the full command line that you are using?

       
    • Hey nightstrike,

      Here's what I have:

      [ironhead] 05/13/08 21:06:16.73
      C:\source\emerge\trunk\Source\emergeLib>set PATH=C:\MinGW64\bin;%PATH%

      [ironhead] 05/13/08 21:06:35.95
      C:\source\emerge\trunk\Source\emergeLib>mingw32-make MINGW64=1 clean
      del ..\.objs64\Release\emergeLib\*.o ..\.objs64\Release\emergeLib\*.res

      [ironhead] 05/13/08 21:07:07.12
      C:\source\emerge\trunk\Source\emergeLib>mingw32-make MINGW64=1
      x86_64-pc-mingw32-g++ -Wall -pedantic -DEMERGELIB_EXPORTS -mno-cygwin -frtti -fexceptions -O2 -c mai
      n.cpp -o ../.objs64/Release/emergeLib/main.o
      main.cpp:79:1: warning: "INTERFACE" redefined
      In file included from main.cpp:39:
      c:\mingw64\bin\../lib/gcc/x86_64-pc-mingw32/4.4.0/../../../../x86_64-pc-mingw32/include/shlwapi.h:93
      3:1: warning: this is the location of the previous definition
      main.cpp: In function 'WINBOOL MinimizeAll(HWND__*, LPARAM)':
      main.cpp:2159: warning: statement has no effect
      x86_64-pc-mingw32-g++ -Wall -pedantic -DEMERGELIB_EXPORTS -mno-cygwin -frtti -fexceptions -O2 -c Shu
      tdown.cpp -o ../.objs64/Release/emergeLib/Shutdown.o
      x86_64-pc-mingw32-windres -O COFF -i emergeLib.rc -o ../.objs64/Release/emergeLib/emergeLib.res
      x86_64-pc-mingw32-windres: emergeLib.rc:65: syntax error
      mingw32-make: *** [../.objs64/Release/emergeLib/emergeLib.res] Error 1

      [ironhead] 05/13/08 21:07:39.89
      C:\source\emerge\trunk\Source\emergeLib>x86_64-pc-mingw32-windres --version
      GNU windres (GNU Binutils) 2.18.50.20080420
      Copyright 2007 Free Software Foundation, Inc.
      This program is free software; you may redistribute it under the terms of
      the GNU General Public License version 3 or (at your option) any later version.
      This program has absolutely no warranty.

      [ironhead] 05/13/08 21:10:33.54
      C:\source\emerge\trunk\Source\emergeLib>x86_64-pc-mingw32-windres -v
      Using `x86_64-pc-mingw32-gcc -E -xc -DRC_INVOKED  -'
      Using popen to read preprocessor output
      ^C

      Line 65 of emergeLib.rc:

        CONTROL "",IDC_LOGO,"Static",SS_BITMAP,0,0,260,60

      If I define SS_BITMAP in resource.h, like I mentioned above, the error goes away.  It just seems that <winuser.h> isn't being found (i.e. the system include directories aren't being searched).

       
    • I solved the issue by adding:

      #define _WINGDI_

      to my resource files.

       
  • SpiroH
    SpiroH
    2012-10-13

    Thanks ir0nh34d!
    After all these years the 'windres' not working problem is still there! That's a real shame and about time to fix it for good. Cheers!