Feb 4 2010

Fixed: Solve fatal error RC1004: unexpected end of file found in C++ resource.h header file

Category: Programming | Windows Ryan @ 02:00

The issue:

Always get fatal error RC1004: unexpected end of file found while building. The Sample file as below

[resource.h]

#define IDI_MYICON 101
#define ID_FILE_EXIT 401

[test.rc]

 

#include "resource.h"
#include <tchar.h>

IDI_MYICON ICON _T("money.ico")

/// Menus
IDR_MYMENU MENU
BEGIN
    POPUP _T("&File")
    BEGIN
        MENUITEM _T("E&xit"),ID_FILE_EXIT
    END
END

 

The Solution:

Make sure there is at least 1 blank row at the end of the header file. In this case,
It should be always a blank row after the line #define ID_FILE_EXIT 401 in resource.h file
Verified on Visual Studio 2008

Tags: , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5