Board index » cppbuilder » invalid OMF record, type 0x00 with string resource

invalid OMF record, type 0x00 with string resource

Hi

As I am lazy and impolite ;-) I've sent this to .language first. Brian
Withnell redirected me here. Ok, I've subscribed to .IDE ( another NG to
follow -yuck!) and I am desperately looking for an answer.

Q#1: If somebody knows why I get linker error:

[Linker Error] 'MYRES.RES' contains invalid OMF record, type 0x00

,where the "myres.res" is *compiled* by C++ Builder 5 form "MYRES.RC" that
contains nothing
but string resources, please let me know.

--------------
Background and additional questions:

At first I have made a component, that includes string resources by

"#pragma link "myres.res"

where I've compiled "myres.res" using resource compiler. In a component  I
use "LoadString", such as

....
String msg = LoadStr( Ident );
if ( msg.IsEmpty() ) msg = DefaultStr;
....

Component compiles and links without problems. I compile and link the
application that uses component statically ( static RTL and no RT packages).
Every time the string is needed I got "DefaultStr" message after API call to
load string resource fails.

Q#2: Are resources linked into package at all? If not, how to make them link
into application automatically with a component?

Ok, I thought, maybe my RC is broken, so I included "mystring.rc" implicitly
into package project. Same result.

At the end I decided to create a testbed project, including "mystring.rc"
into an application project (note: component still included). The result is
shown above.

Q#3: How comes I didn't get the same linker error when linking the package?
Q#4: How in the world can I link package resources into an application?

TIA,

goran

 

Re:invalid OMF record, type 0x00 with string resource


Quote
"Goran Bervar" <n.e.b.e.r....@yahoo.com> wrote in message

news:3c109c37_2@dnews...

Quote

> "#pragma link "myres.res"

Sorry. That was a typo. I do have:

#pragma resource "myres.res"

goran

Re:invalid OMF record, type 0x00 with string resource


Quote
"Goran Bervar" <n.e.b.e.r....@yahoo.com> wrote in message

news:3c109c37_2@dnews...

... to continue this monolgue, I have just find out two things:

1) using resource editor I have find out that assuming "mycompnonet.cpp" as
source

#pragma resource "*.res"
#pragma resource "myres.res"

second pragam is silently ignored when building a package. Moving
stringtable to "mycompnonet.res" and including

#pragma resource "*.res"

only links strings into a bpl. Is this correct? Why? Is it documented
anywhere?

2) I _might_ find out why I got OMF record error. It happened that some evil
creature removed Samples package from my home computer( My package used
CGauge) but probably BPL and BPI were still laying around as project linked
succesfully ?!. I compiled same application at work and it was a success. I
have yet to find out if this is the reason for OMF error.

TTFN,

goran

Other Threads