Mark- 29 Posted January 21, 2020 (edited) Hello, Delphi 10.2 I am trying to compile an RC file included with the project. {$R 'ResStr.res' 'ResStr.rc'} Regardless of what I put in the RC file I get [on the first line]: [BRCC32 Error] ResStr.rc(1): Fatal error Expecting resource name or resource type name Ideas or anyone have a sample RC file that complies without error? Thanks, Mark Edited January 21, 2020 by Mark- Share this post Link to post
Mark- 29 Posted January 21, 2020 (edited) Hello, Thanks for the response. I added in the first post, the error is on the first line. Every example I could find on the web, in many formats. I could not find a single working example. Mark Edited January 21, 2020 by Mark- Share this post Link to post
timfrost 78 Posted January 21, 2020 It would be helpful if you could say what you propose to use the resource file for. I have dozens of resource files but they may not be relevant for you. What happens if you compile an RC file containing: STRINGTABLE BEGIN 1, "Hello" 2, "World" END Share this post Link to post
Mark- 29 Posted January 21, 2020 Hello, Thanks timfrost for the response. Quote What happens if you compile an RC file containing: I copied/pasted the example code into the RC file, complied (Shift F9) and got the same error message. Quote It would be helpful if you could say what you propose to use the resource file for. Perhaps string table or RCDATA, I have not decided. At this point I am just trying to get anything to compile. Mark Share this post Link to post
Anders Melander 1782 Posted January 21, 2020 22 minutes ago, timfrost said: STRINGTABLE BEGIN 1, "Hello" 2, "World" END Although the RC compiler will accept that, the correct format would be: STRINGTABLE BEGIN 0 "Hello" 1 "World" END I.e. no comma between ID and Value. Share this post Link to post
Anders Melander 1782 Posted January 21, 2020 1 hour ago, Mark- said: Regardless of what I put in the RC file I get [on the first line]: [BRCC32 Error] ResStr.rc(1): Fatal error Expecting resource name or resource type name Ideas or anyone have a sample RC file that complies without error? Your file encoding is wrong. Make sure that it's ANSI or UTF8 without BOM - or even better use the Win SDK RC compiler (set this in the project options). I've attached one that works. test.rc 1 Share this post Link to post
David Heffernan 2345 Posted January 21, 2020 51 minutes ago, Mark- said: Hello, Thanks for the response. I added in the first post, the error is on the first line. Every example I could find on the web, in many formats. I could not find a single working example. Mark I can't see your rc file. Can you include it. Share this post Link to post
Mark- 29 Posted January 21, 2020 Hello, Quote Your file encoding is wrong. Make sure that it's ANSI or UTF8 without BOM - or even better use the Win SDK RC compiler (set this in the project options). Bingo. Thank you. Quote or even better use the Win SDK RC compiler (set this in the project options). OK, is that a better resource compiler? Quote I can't see your rc file. Can you include it. It only had the string table as shown above. The file encoding was the issue. Everyone, thanks for the help. Mark Share this post Link to post
Anders Melander 1782 Posted January 21, 2020 Just now, Mark- said: OK, is that a better resource compiler? It's better maintained and supports more features. The RC format is a proprietary Microsoft format with no formal definition so Microsoft will always be able to support it better. There are some RC features that are not supported by brcc32 but I can't remember which right now. brcc32 also has some features that are not supported by the Microsoft compiler, but it would be stupid to use those today. They're from the time when Borland still was contender (i.e. Borland C++ 5 era). 3 minutes ago, Mark- said: It only had the string table as shown above. The file encoding was the issue. Yes, but if you had included the file then we wouldn't have had to guess. Share this post Link to post
Remy Lebeau 1393 Posted January 22, 2020 1 hour ago, Anders Melander said: The RC format is a proprietary Microsoft format with no formal definition Really? About Resource Files, looks pretty formal to me. Share this post Link to post
Vincent Parrett 750 Posted January 22, 2020 2 hours ago, Anders Melander said: There are some RC features that are not supported by brcc32 but I can't remember which right now. Not sure if this is still the case, but hi color icons were not supported by brcc. I switched to using rc years ago because of this and never bothered switching back, so maybe that's been fixed (but I would not be surprised if it hasn't been). Share this post Link to post
Anders Melander 1782 Posted January 22, 2020 8 hours ago, Remy Lebeau said: Really? About Resource Files, looks pretty formal to me. Yes. I can see the documentation has definitely improved since I wrote the Resource Editor. File encoding doesn't appear to be mentioned though. Still the RC compiler supports a lot of undocumented stuff that is only mentioned in the source (which I might or might not have read). Share this post Link to post
Anders Melander 1782 Posted January 22, 2020 6 hours ago, Vincent Parrett said: hi color icons were not supported by brcc. Yes, that's the one. The Microsoft RC compiler also has some (undocumented) features that enables two-way tooling (e.g. a Resource Editor); It can report on included header files, defined symbols and their values and a few other things. Share this post Link to post