Thread: Weird compile error *newbie to Win32*

  1. #1
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378

    Weird compile error *newbie to Win32*

    hey, i'm trying to teach myself win32 api programming because i dont want to be stuck in a command prompt any longer but i'm reading a tutorial on winprog.org and when compiling some code in a resource file, i'm getting a compiler error. I use Dev-C++..
    Code:
    IDD_ABOUTDLG DIALOG DISCARDABLE 0, 0, 239, 66
    STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
    CAPTION ". About ."
    FONT 8, "Century Gothic"
    BEGIN
         DEFPUSHBUTTON      "&Ok", IDOK, 174, 18, 50, 14
         PUSHBUTTON         "&Cancel", IDCANCEL, 174, 35, 50, 14
         GROUPBOX           "About this program...", IDC_STATIC, 7, 7, 225, 52
         CTEXT              "My venture into the world of Win32 API Programming.", IDC_STATIC,16,18,144,33
    END
    <error>[Resource error] syntax error
    [Build Error] [WinTest02_private.res] Error 1


    or more detailed..i hope?
    windres.exe -i WinTest02_private.rc --input-format=rc -o WinTest02_private.res -O coff

    windres.exe: icon.rc:27: syntax error

    make.exe: *** [WinTest02_private.res] Error 1

    Execution terminated</error>

    also, what compiler options should i set? thanks
    Registered Linux User #380033. Be counted: http://counter.li.org

  2. #2
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Try...

    Code:
    #include <windows.h>
    #define IDC_STATIC -1
    IDD_ABOUTDLG DIALOG DISCARDABLE 0, 0, 239, 66
    STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
    CAPTION ". About ."
    FONT 8, "Century Gothic"
    BEGIN
         DEFPUSHBUTTON      "&Ok", IDOK, 174, 18, 50, 14
         PUSHBUTTON         "&Cancel", IDCANCEL, 174, 35, 50, 14
         GROUPBOX           "About this program...", IDC_STATIC, 7, 7, 225, 52
         CTEXT              "My venture into the world of Win32 API Programming.", IDC_STATIC,16,18,144,33
    END

  3. #3
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378
    sweet... thats not my entire .rc file, just the part giving me an error so i already had <windows.h> included as its required for the style to not spout out an error thanks
    Registered Linux User #380033. Be counted: http://counter.li.org

  4. #4
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Sorry if I'm being slow, but does that mean your problem was solved or not?

  5. #5
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    Quote Originally Posted by Dante Shamest
    Sorry if I'm being slow, but does that mean your problem was solved or not?
    I was wondering the same thing, presumably it hasn't.
    If the problem isn't solved then
    windres.exe: icon.rc:27: syntax error
    which line of what you posted is 27?

  6. #6
    Shibby willc0de4food's Avatar
    Join Date
    Mar 2005
    Location
    MI
    Posts
    378
    sorry, that solved my problem. i had to define ID_STATIC. line 27 is the line that GROUPBOX is on.

    mmm..and i thought i had another problem, but i realized it was just pure stupidity and i had to actually read my error message instead of just think i'm getting an error. however, i'm getting an error that says "syntax error at end of input." but i probably just forgot to dot a t or cross an i.. (i.e. i forgot a } somewhere............specifically one on my switch statement in WndProc ^_^ whoops, *shrug* another one down.)
    Last edited by willc0de4food; 05-12-2005 at 11:02 PM.
    Registered Linux User #380033. Be counted: http://counter.li.org

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Weird Output when I compile?
    By unejam2005 in forum C++ Programming
    Replies: 3
    Last Post: 12-13-2005, 01:46 AM
  2. compile program?
    By Goosie in forum C++ Programming
    Replies: 9
    Last Post: 06-22-2005, 02:26 PM
  3. dvv-cpp not able to compile?
    By Rune Hunter in forum C++ Programming
    Replies: 12
    Last Post: 10-23-2004, 06:36 PM
  4. Replies: 3
    Last Post: 03-27-2004, 12:15 PM
  5. compile once, compile twice ...error
    By Benzakhar in forum Windows Programming
    Replies: 6
    Last Post: 12-28-2003, 06:00 AM