Board index » cppbuilder » Linker error again

Linker error again


2004-07-07 04:39:53 AM
cppbuilder81
I hate to post it again but I could not fix it with the help from the last
post.
[Linker Error] Failed to read from C:\PROGRAM
FILES\BORLAND\CBUILDER6\PROJECTS\LIB\BSVCL.LIB at offset 4774144 for 8192
bytes
[Linker Error] Failed to read from C:\PROGRAM
FILES\BORLAND\CBUILDER6\PROJECTS\LIB\BSVCL.LIB at offset 4882944 for 8192
bytes
...
If I changed codes and click "Project | Make" recompile it, the errors
appear. But it is disppeared when I make the project again. So every time I
need to make a project twice.
I hope Borland guys can figure out the problem. Thanks
Qimiao
 
 

Re:Linker error again

"Qimiao Lu" < XXXX@XXXXX.COM >wrote in message
Quote
I hate to post it again but I could not fix it with the help from the last
post.

[Linker Error] Failed to read from C:\PROGRAM
FILES\BORLAND\CBUILDER6\PROJECTS\LIB\BSVCL.LIB at offset 4774144 for 8192
bytes
[Linker Error] Failed to read from C:\PROGRAM
FILES\BORLAND\CBUILDER6\PROJECTS\LIB\BSVCL.LIB at offset 4882944 for 8192
bytes
...

If I changed codes and click "Project | Make" recompile it, the errors
appear. But it is disppeared when I make the project again. So every time
I
need to make a project twice.

I hope Borland guys can figure out the problem. Thanks

Qimiao
Just a wild guess. I'm assuming here that BSVCL.LIB is your project. Open
the project and go to Project Options->TLIB. Try increasing the page size.
This allows for a larger lib file.
HTH
- Arnie
 

Re:Linker error again

"Arnie Mauer" < XXXX@XXXXX.COM >wrote in message
Quote
"Qimiao Lu" < XXXX@XXXXX.COM >wrote in message
news:40eb0e1b$ XXXX@XXXXX.COM ...
>I hate to post it again but I could not fix it with the help from the
last
>post.
>
>[Linker Error] Failed to read from C:\PROGRAM
>FILES\BORLAND\CBUILDER6\PROJECTS\LIB\BSVCL.LIB at offset 4774144 for
8192
>bytes
>[Linker Error] Failed to read from C:\PROGRAM
>FILES\BORLAND\CBUILDER6\PROJECTS\LIB\BSVCL.LIB at offset 4882944 for
8192
>bytes
>...
>
>If I changed codes and click "Project | Make" recompile it, the errors
>appear. But it is disppeared when I make the project again. So every
time
I
>need to make a project twice.
>
>I hope Borland guys can figure out the problem. Thanks
>
>Qimiao

Just a wild guess. I'm assuming here that BSVCL.LIB is your project.
Open
the project and go to Project Options->TLIB. Try increasing the page
size.
This allows for a larger lib file.

HTH

- Arnie


Thanks.
Yes. BSVCL is my package name, However, I could not find the TLIB page in
the project option because that page is only visible for a library project
but my project is VCL package project. Any idea?
Qimiao
 

{smallsort}

Re:Linker error again

Hi,
Quote
Yes. BSVCL is my package name, However, I could not find the TLIB page in
the project option because that page is only visible for a library project
but my project is VCL package project. Any idea?
How big is the BSVCL.LIB? It is a static library that is produced
by the linker switch -Gl. I can't remember for sure, but this switch
(and static package libs) may not have existed in BCB5. (previouly,
when not "building with runtime packages", the linking was done
directlly to the .OBJ's. Is there something unique about the package
that would affect this static LIB? e.g. is it incredibly huge? Are
there many global symbols or many many units? Can you change your
project to link with the "Build with runtime packages" switch turned
ON? (This means you would link against the <Package>.BPI not the
<Package>.LIB).
--Craig
 

Re:Linker error again

"Craig Farrell" < XXXX@XXXXX.COM >wrote in message
Quote
Hi,


>Yes. BSVCL is my package name, However, I could not find the TLIB page
in
>the project option because that page is only visible for a library
project
>but my project is VCL package project. Any idea?


How big is the BSVCL.LIB? It is a static library that is produced
by the linker switch -Gl. I can't remember for sure, but this switch
(and static package libs) may not have existed in BCB5. (previouly,
when not "building with runtime packages", the linking was done
directlly to the .OBJ's. Is there something unique about the package
that would affect this static LIB? e.g. is it incredibly huge? Are
there many global symbols or many many units? Can you change your
project to link with the "Build with runtime packages" switch turned
ON? (This means you would link against the <Package>.BPI not the
<Package>.LIB).

--Craig

Thanks. I should make more clearly:
I have a Package project named as BsVcl.bpr which consists of many units (or
visual components). There are some global symbols but not too many. When I
compile the package using Make method, it seems to create the files
BsVcl60.pbl (size: 1.1mb), BsVcl60.tds (8 mb), BsVcl.pbi (160kb) , and
BsVcl.lib (8.5 mb). The linker always complains the error as I mentioned.
For a Package project, the check box of "Build with runtime packages" is
disabled but the box is always checked. I don't why the linker is looking
for BsVcl.lib. As you mentioned, it should link directly to *.OBJ's.
I had tried to edit the project option using a text editor and delete the
name "BsVcl.lib" in the lines of <LIBRARIES />and <SPARELIBS />. Then
start BCB and just open only this project (not open it through project
group). The compiler is OK. However, when I open the project Group Files
(.bpg) which contains this project. The BsVcl.lib is automatically added
into these two lines in the project file (BsVcl.bpr) and the linker error is
occurred. I don't understand why BCB always add the BsVcl.lib in these two
lines when I try to open it though a project group file.
However, I have a few small packages in the same project group. There is no
error occured for these smaller projects even I notice that the *.lib is
also included in the two lines of these project files. I guess it may be a
streaming conflict with big file.
Qimiao
 

Re:Linker error again

Hi,
Quote
I have a Package project named as BsVcl.bpr
Package projects have a .bpk extension. That odd
extension you have might cause some problems. I'd
suggest creating a brand new package and adding source
only to it and rebuilding.
Quote
for BsVcl.lib. As you mentioned, it should link directly to *.OBJ's.
Now that we know you are using a package project, I think we can
assume that the linker error shows up while the linker is generating
the static lib, not when trying to link an executable to the static
lib. What happens if you turn OFF the -Gl switch (Project | Options |
Linker | Generate .lib file?
Quote

I had tried to edit the project option using a text editor and delete the
name "BsVcl.lib" in the lines of <LIBRARIES />and <SPARELIBS />.
Going back the first problem I think. Create a new package project.
It sounds like your package project (which will generate a
<packagename>.lib by default) has it's own product (<packagename>.lib)
on it's own link line. It seems to me that could definitely cause
an odd error like you describe.
--Craig
 

Re:Linker error again

Thank you very much for your help, See below comments.
Qimiao
"Craig Farrell" < XXXX@XXXXX.COM >wrote in message
Quote
Hi,

>I have a Package project named as BsVcl.bpr

Package projects have a .bpk extension. That odd
extension you have might cause some problems. I'd
suggest creating a brand new package and adding source
only to it and rebuilding.

It is a .bpk file extension - sorry I made the mistake in last post. I did
try to create a brand package and add all sources again. So some errors for
example "Unresolved external 'symbol' referenced from 'module'" can be
avoided. But no luck for this linker error.
Quote
>for BsVcl.lib. As you mentioned, it should link directly to *.OBJ's.

Now that we know you are using a package project, I think we can
assume that the linker error shows up while the linker is generating
the static lib, not when trying to link an executable to the static
lib. What happens if you turn OFF the -Gl switch (Project | Options |
Linker | Generate .lib file?

I am not sure whether the error is generated when the linker generates the
lib or when the linker loads the lib. But the error message tell that the
linker try to read the lib. The problem may be caused by the linker writes
and reads the lib in the same time (just guess) according to a few evidences
I found
- it is disppeared if <packagename>.lib in project option file is manually
removed;
- it is dispeared if I compile the package again - I understand that the
second time MAKE only do linking so without generating the lib;
It works if I turn -G1 switch off . But this arises another problem for me.
Since this package will be used for some other packages or projects, I must
generete the lib.
Quote
>
>I had tried to edit the project option using a text editor and delete
the
>name "BsVcl.lib" in the lines of <LIBRARIES />and <SPARELIBS />.


Going back the first problem I think. Create a new package project.
It sounds like your package project (which will generate a
<packagename>.lib by default) has it's own product (<packagename>.lib)
on it's own link line. It seems to me that could definitely cause
an odd error like you describe.

I agree. It seems there is no easy solution to fix this error. The settings
for compiler and linker seem to be automatically changed by BDE. No matter
how to modify the contents in <LIBRARIES />and <SPARELIBS />lines
manually, the <packagename>.lib is always added into the two lines after
saving. Is there any reason Borland needs to do like this?
Quote
--Craig

 

Re:Linker error again

Is the package name being registered the same as the project name of the
package?
Qimiao Lu wrote:
Quote
- it is disppeared if <packagename>.lib in project option file is manually
removed;
- it is dispeared if I compile the package again - I understand that the
second time MAKE only do linking so without generating the lib;

>Going back the first problem I think. Create a new package project.
>It sounds like your package project (which will generate a
><packagename>.lib by default) has it's own product (<packagename>.lib)
>on it's own link line.

I agree. It seems there is no easy solution to fix this error. The settings
for compiler and linker seem to be automatically changed by BDE. No matter
how to modify the contents in <LIBRARIES />and <SPARELIBS />lines
manually, the <packagename>.lib is always added into the two lines after
saving. Is there any reason Borland needs to do like this?

 

Re:Linker error again

No, I use the LIB surfix feature so the package name is
<projectname+60>.bpl. Qimiao
"Valence Crearer" < XXXX@XXXXX.COM >wrote in message
Quote
Is the package name being registered the same as the project name of the
package?

Qimiao Lu wrote:

>- it is disppeared if <packagename>.lib in project option file is
manually
>removed;
>- it is dispeared if I compile the package again - I understand that the
>second time MAKE only do linking so without generating the lib;
>
>>Going back the first problem I think. Create a new package project.
>>It sounds like your package project (which will generate a
>><packagename>.lib by default) has it's own product (<packagename>.lib)
>>on it's own link line.
>
>I agree. It seems there is no easy solution to fix this error. The
settings
>for compiler and linker seem to be automatically changed by BDE. No
matter
>how to modify the contents in <LIBRARIES />and <SPARELIBS />lines
>manually, the <packagename>.lib is always added into the two lines after
>saving. Is there any reason Borland needs to do like this?
>

 

Re:Linker error again

Qimiao Lu wrote:
Quote
No, I use the LIB surfix feature so the package name is
<projectname+60>.bpl. Qimiao
This is just a guess based on what Craig said, and your response.
I'm betting that if the name of the .bpk matches the .bpl/.lib it will work
fine, but will mess up when they don't. Is it possible to name the .bpk the same
as the .bpl, less the extension of course?
 

Re:Linker error again

Quote
"Valence Crearer" wrote:

This is just a guess based on what Craig said, and your response.

I'm betting that if the name of the .bpk matches the .bpl/.lib it will
work
fine, but will mess up when they don't. Is it possible to name the .bpk
the same
as the .bpl, less the extension of course?

It seems not a easy job. When I change the pacakge name and delete LIB
suffix, the compiler for this package is OK but there are some side effects
with other packages that use this package. Anyway, I need to adjust all
others lately. Thanks for your and Craig's help.
Regards.
Qimiao
 

Re:Linker error again

Thank you very much! I didn't look at the download site for one month. Now
there's really ilinker patch!
Once again thank you.
Regards,
Pavel
----- Original Message -----
From: "Wayne A. King" < XXXX@XXXXX.COM >
Newsgroups: borland.public.cppbuilder.upgrade
Sent: Thursday, July 15, 2004 4:39 PM
Subject: Re: BCB 6 Service pack #5
Quote
On Thu, 15 Jul 2004 15:45:18 +0200, "Pavel Zvonicek"
< XXXX@XXXXX.COM >
wrote:

>does anyone know anything about Service pack #5 for C++ Builder 6
>I would really like getting rid of ... Linker fatal errors.
>I am unable to compile and link large project

I believe there is a patch for the linker problem in BCB 6 now available
for download. Did you try checking Borland's web site recently? e.g. -

altd.borland.com/devsupport/cbuilderx/C++B6_and_C++BX_linker_patc
h/readme.html

or

tinyurl.com/3jg5l


--
Wayne A. King
( XXXX@XXXXX.COM , XXXX@XXXXX.COM
"Qimiao Lu" < XXXX@XXXXX.COM >píše v diskusním příspěvku
Quote
I hate to post it again but I could not fix it with the help from the last
post.

[Linker Error] Failed to read from C:\PROGRAM
FILES\BORLAND\CBUILDER6\PROJECTS\LIB\BSVCL.LIB at offset 4774144 for 8192
bytes
[Linker Error] Failed to read from C:\PROGRAM
FILES\BORLAND\CBUILDER6\PROJECTS\LIB\BSVCL.LIB at offset 4882944 for 8192
bytes
...

If I changed codes and click "Project | Make" recompile it, the errors
appear. But it is disppeared when I make the project again. So every time
I
need to make a project twice.

I hope Borland guys can figure out the problem. Thanks

Qimiao