2

I am trying to compile a .rc file to link the generated .res file to my linker to get my project resources to be included in my .exe.

The problem that I have is that I can't get RC to compile my .rc file. I always get the same error message :

Blockquote fatal error RC1109: error creating stuff.res

And the verbose option doesn't help much and only adds this:

Blockquote Using codepage 1252 as default

I added my resources to my .rc using the resource editor dialog, I didn't write the file myself. The only thing that I did is to change the type "TXT" that I first though good to "RCDATA" in the above code :

    // Microsoft Visual C++ generated resource script.
//
#include "resource1.h"

#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"

/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////
// Français (France) resources

#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH

#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//

1 TEXTINCLUDE 
BEGIN
    "resource1.h\0"
END

2 TEXTINCLUDE 
BEGIN
    "#include ""winres.h""\r\n"
    "\0"
END

3 TEXTINCLUDE 
BEGIN
    "\r\n"
    "\0"
END

#endif    // APSTUDIO_INVOKED


/////////////////////////////////////////////////////////////////////////////
//
// PNG
//

IDB_PNG1                PNG                     "Ressources\\Gamma-Sup.png"

IDB_PNG2                PNG                     "Ressources\\Interface.png"


/////////////////////////////////////////////////////////////////////////////
//
// Font
//

IDR_FONT1               FONT                    "Ressources\\font_1.ttf"


/////////////////////////////////////////////////////////////////////////////
//
// TXT
//

IDR_TXT1                RCDATA                     "Ressources\\Probe List.txt"

IDR_TXT2                RCDATA                     "Ressources\\ProgressBar - Green.txt"

IDR_TXT3                RCDATA                     "Ressources\\ProgressBar - Red.txt"

IDR_TXT4                RCDATA                     "Ressources\\ProgressBar - Yellow.txt"

#endif    // Français (France) resources
/////////////////////////////////////////////////////////////////////////////



#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//


/////////////////////////////////////////////////////////////////////////////
#endif    // not APSTUDIO_INVOKED

The IDS I am using are all defined in my .h file :

    //{{NO_DEPENDENCIES}}
// fichier Include Microsoft Visual C++.
// Utilisé par GammaSup3.rc
//
#define IDB_PNG1                        101
#define IDB_PNG2                        102
#define IDR_FONT1                       103
#define IDR_TXT1                        104
#define IDR_TXT2                        105
#define IDR_TXT3                        106
#define IDR_TXT4                        107

// Next default values for new objects
// 
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        108
#define _APS_NEXT_COMMAND_VALUE         40001
#define _APS_NEXT_CONTROL_VALUE         1001
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif

I used several commands to compile my file , all resulting in the same error message. As I start to have tried all the options available, I feel a bit lost.

Blockquote rc /d DEBUG /i c:/source/stuff/resources filename.rc

I tried without or with less options(/x /l). My project is in DEBUG configuration . I am sure that i don't have a typo in my path here cause i paste it from the file explorer. I also tried to compile a just auto generated .rc file without adding any resources to it and RC still won't compile it.

What I want is Rc to generate a single language dependant .res file , not two.

I'm ashamed with the idea of asking you about some command line problem, but i'm pretty much a newbie and I really don't get what is going on here. Any suggestion is very welcome as I really would like to be able to use RC.

prof_chen
  • 21
  • 3
  • I created an empty project in VS2017, then I copied and pasted your code, recreating the same directory tree with the same files. I don't know if the header file you posted is complete. I just added the directive '#pragma once' at the top and VS 2017 compiles without problems. – Sergio May 13 '19 at 18:57
  • Thank you Sergio. I'm new to c++ and just learned about that preprocessor directive, and i realized that I don't need to compile my file using RC at all. – prof_chen May 14 '19 at 12:43

0 Answers0