Board index » cppbuilder » Yet another problem...

Yet another problem...


2007-08-02 07:12:11 AM
cppbuilder107
I've 'succeeded' (I think) in porting my project from BCB5 to BCB2007.
I have the 'new' project on a completely separate computer to test it,
and have not installed BCB2007 on my main development computer as yet,
so that my normal work environment is unchanged.
I synchronized (carefully) my directories so that both directories on
the two machines are identical (essentially copying over the new project
files for BCB2007, and ensuring that the changes I'd made in my source
files wouldn't conflict with BCB5). I then ensured that both machines
could compile the source code using their respective versions of software.
I then attempted to load my laptop up with everything. For a variety of
reasons, I completely formatted and reinstalled the OS in my laptop
(WinXP Pro). I then installed Delphi5 and BCB5 and updated them (but
have not used them, they're simply installed on the machine). I then
installed Delphi 2007 and BCB2007 (note that as outlined previously,
'installing' BCB2007 doesn't happen unless you know which boxes to check
-- it is completely non-intuitive, nor is the 'help' any help). I then
copied the entire directory structures of my existing third-party
TurboPower tools over, re-compiled and installed the packages, and
ensured that they were present in BDS.
Finally, I copied the entire directory structure of my project from my
'main' computer (which is running BCB5) to my laptop and attempted to do
a full 'build' of the project.
Lo and behold, I keep getting an error that it can't open VCLE50.LIB.
It happens multiple times, so it isn't a fluke.
I scratch my head, and try to figure out what's going on. Somewhere,
obviously, I must have a reference to VCLE50.LIB in one of my project
files. I try to find a way to have BCB2007 show me what libraries are
'in use' for the project, but can't seem to find anything obvious. So,
I'm reduced to searching through my directory structure to find which of
the various source or project files have that reference. After much
wasted time, I find nothing -- not a single reference. I finally
decided to search every possible file for references, and guess what?
The only reference is in the OBJ files!
Yes, that's right, despite the fact that I told the IDE to do a 'build'
of the project, it looked at the timestamps of the OBJ files and of the
source files, and decided that I must not really MEAN that I wanted it
to do a complete build, so it was using the OBJ files from the BCB5
compilation!!!
At first I was kicking myself for not erasing the OBJ files in the first
place, but then I realized that BUILD should mean BUILD, not MAKE.
Has anyone else run into this, or similar issues?
BTW, on a related but different note, I had accidentally erased the .HPP
file for FastMM4.PAS. No problem, I went to the Project menu and told
it to compile the unit. But the unit is not generating the header file!
It turns out that it was compiling previously because the header file
had previously been generated by the BCB5 compilation -- any hints on
what may be going wrong? The Project options for the Delphi compiler
options tell it to generate the header files, but nothing is being
output (I've searched all drives).
Comments???
David Erbas-White
 
 

Re:Yet another problem...

Quote
Comments???
I've not seen the 'build' not re-compiling sources.
You can have the option to display the command line for the
compiler/linker when building. This way you can see what gets passed to
the tools. It's in the Tools|Options|Environment Options|Compiling and
running.
 

Re:Yet another problem...

Alex Bakaev [TeamB] wrote:
Quote

>Comments???

I've not seen the 'build' not re-compiling sources.

You can have the option to display the command line for the
compiler/linker when building. This way you can see what gets passed to
the tools. It's in the Tools|Options|Environment Options|Compiling and
running.
I've done as you suggested, and can view the files/options that are
passed, but it doesn't tell me if the compiler is actually generating a
new object file.
I've gone back to my 'test' machine, and try as I might I can't get the
Fastmm4.PAS file that's in my project to generate either a DCU or HPP
file -- yet the program appears to compile correctly. It doesn't seem
to 'accomplish' anything when I tell it to simply compile that unit by
itself, either.
I'm sure I must be doing something wrong, but don't know how/why a
plain-vanilla fresh installation of BDS2007 would be acting this way...
David Erbas-White
 

{smallsort}

Re:Yet another problem...

David Erbas-White wrote:
[...]
Quote
I've done as you suggested, and can view the files/options that are
passed, but it doesn't tell me if the compiler is actually generating a
new object file.
Are you sure your object files end up where you expect them to and not
in another directory, e.g. a Debug_Build one, or some such?
Cheers,
Nicola Musatti
--
Nicola Musatti
Team Azzurro
nicola.musatti.googlepages.com/home
 

Re:Yet another problem...

"David Erbas-White" < XXXX@XXXXX.COM >wrote in message
Quote
At first I was kicking myself for not erasing the OBJ files in the first
place, but then I realized that BUILD should mean BUILD, not MAKE.

Has anyone else run into this, or similar issues?
I have 2006 Explorer version. I haven't had it not build but I've had
it not build what I thought I told it to build. I was trying to benchmark
something in a project and switching between release/debug builds
but it wasn't actually working. I noticed that my times weren't making
sense
but didn't actually find the problem until I did a clean (del *.obj etc.) to
find that the other build was happening. I think this was mostly due to
my not properly switching builds and I don't know if it's different in
2007.
Maybe it's something like that? Certainly, the timestamp shouldn't
come into it except for makes.
 

Re:Yet another problem...

Nicola Musatti wrote:
Quote
David Erbas-White wrote:
[...]
>I've done as you suggested, and can view the files/options that are
>passed, but it doesn't tell me if the compiler is actually generating
>a new object file.

Are you sure your object files end up where you expect them to and not
in another directory, e.g. a Debug_Build one, or some such?

Cheers,
Nicola Musatti
Just to be sure, I ended up searching ALL of BOTH hard drives. Not
found... (assuming the Windows search feature is working, that is)
David Erbas-White
 

Re:Yet another problem...

Hi,
Quote
Lo and behold, I keep getting an error that it can't open VCLE50.LIB. It
happens multiple times, so it isn't a fluke.
Sounds like an issue with a #pragma link resulting in something(s)
not being rebuilt. These pragmas could be in VCL headers and/or
your own headers and .cpp source. I suggest grep'ing through both
VCL headers and your own .h and .cpp. Note there are two forms
for linking a lib or obj that are equivalent so grep for both:
#pragma comment(lib, "vcle.lib")
#pragma link "vcle.lib"
Here is what a grep in BCB6 VCL headers shows...
c:\program files\borland\cbuilder6\include\vcl>grep -i pragma.*vcle *.h
*.hpp
File sysmac.h:
#pragma comment(lib, "vcle.lib")
grep through your own directories with something like:
grep -ild pragma.*link *.h *.hpp *.cpp
and
grep -ild pragma.*lib *.h *.hpp *.cpp
--Craig
 

Re:Yet another problem...

Quote
grep through your own directories with something like:
grep -ild pragma.*link *.h *.hpp *.cpp
and
grep -ild pragma.*lib *.h *.hpp *.cpp
So if you have in your source
#pragma link "somecomponent.obj"
then the problem is somecomponent.obj has been
built with BCB5 and needs to be rebuilt.
--Craig
 

Re:Yet another problem...

Craig Farrell wrote:
Quote
then the problem is somecomponent.obj has been
built with BCB5 and needs to be rebuilt.

I think that's the crux of the problem - BDS didn't rebuild sources.
 

Re:Yet another problem...

In article <46b239f4$ XXXX@XXXXX.COM >,
"Alex Bakaev [TeamB]" < XXXX@XXXXX.COM >wrote:
Quote
I think that's the crux of the problem - BDS didn't rebuild sources.
Not for files outside of the project. If #pragma link "whatever.obj"
is in a file from your project but whatever.cpp is not in your project,
the IDE has no reason to recompile whatver.cpp
What makes it worse is that whatever.cpp could have a #pragma link
"something_else" in it as well, so it would be trying to link in
something_else.obj as well.
--
-David Dean
CodeGear C++ QA Engineer
<blogs.codegear.com/ddean/>
 

Re:Yet another problem...

Hi,
Quote
What makes it worse is that whatever.cpp could have a #pragma link
"something_else" in it as well, so it would be trying to link in
something_else.obj as well.

Yes, my post wasn't very clear. I was trying to say
that because sysmac.h has #pragma comment(lib, "vcle.lib")
in it, then either the BCB5 include directory is being
found in the rebuilds or an .obj from BCB5 is being found.
In the latter case, that BCB5 obj has a comment record in
it, tellling the linker it must link vcle50.lib.
--Craig
 

Re:Yet another problem...

Craig Farrell wrote:
Quote
Hi,
>What makes it worse is that whatever.cpp could have a #pragma link
>"something_else" in it as well, so it would be trying to link in
>something_else.obj as well.
>
Yes, my post wasn't very clear. I was trying to say
that because sysmac.h has #pragma comment(lib, "vcle.lib")
in it, then either the BCB5 include directory is being
found in the rebuilds or an .obj from BCB5 is being found.
In the latter case, that BCB5 obj has a comment record in
it, tellling the linker it must link vcle50.lib.

--Craig

I appreciate all the comments and hints, but let me be clear -- the .OBJ
files of MY project were not being rebuilt, and were the old BCB5 files.
Those files, and ONLY those files, contained references to VCLE50.LIB.
Erasing those object files (from source code contained within my
project) caused everything to be built and linked correctly.
The crux of the problem is that the .OBJ files were not being rebuilt,
despite being instructed to 'build'.
David Erbas-White
 

Re:Yet another problem...

I manually opened the project file in a text editor and removed the lib
from there. It compiled fine after that.
 

Re:Yet another problem...

David Erbas-White wrote:
Quote
let me be clear -- the .OBJ
files of MY project were not being rebuilt,
Can you recreate this in a project that you can post (or email)? From
your description it does sound like a bug, but I no longer have BCB5
installed to play around with. I did not see this problem with the
BCB6 projects I imported.
- Leo