0

I´m working on VS2015 with a C++ project containing only one .rc file. I would like to change the content of my .rc file with preprocessor directives. For example, #define freeVersion, set somewhere else in a header file.

But for some reasons, when I include the header file containing the define, I got errors like:

rc1004 unexpected end of file found

Is there a way to fix this issue (read about it but found nothing)? Should I use multiple .rc files (free.rc / nonFree.rc for example)?

Acorn
  • 24,970
  • 5
  • 40
  • 69
Erwan Douaille
  • 553
  • 1
  • 10
  • 31
  • 1
    PP directives and include files etc all work in .rc files so it's hard to tell what your actual problem is: please show actual code to reproduce the problem. – stijn Apr 16 '20 at 08:44
  • 2
    Sound like you have a non-POSIX file created with no *newline* after the final text in the file. Some object compilers can be finicky. Make the change to add a newline, then open the *VS Developer's Command Prompt* and attempt to compile your resource file to object with `rc /Fonameoffile.res nameoffile.rc` and see if the error occurs again. (a single resource file is fine) The `/Fo` option just allows you to provide a name for the compiled resource object file you will like with your program. – David C. Rankin Apr 16 '20 at 08:46
  • The problem was a bad end of line character ... Thanks ;) – Erwan Douaille Jun 10 '20 at 11:47

0 Answers0