Home > Archive > VC Language > May 2006 > Strange build problem
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Strange build problem
|
|
| keepyourstupidspam@yahoo.co.uk 2006-05-19, 7:08 pm |
| Hi,
I have a strange build problem.
I am building an exe, this exe links to a number of static libraries
maybe 20 in all and all are built from my code. I am using the gmake
build system and the MS visual studio 2003 compiler and linker.
When I perform a completely clean build the binary builds fine to a
size of 2900K but if i make a small code change to a cxx file and only
perform a build that is not a complete clean build then the binary only
builds to 2200K.
In both cases the code builds without any errors but in the case of the
smaller exe the program starts but just terminates pretty much in thin
air. It Usually terminated in the instance() function of a singleton,
this singleton is a template base class used by a few classes that I
want to be singletons.
I can get it to work for me if I delete only one of the .lib files the
binary links to, it is always the same lib file, then it will build to
2900k without a clean build.
This is very strange, is my build not linking to some file.
Can anyone help me with this one?
Please,
Enda
| |
| Victor Bazarov 2006-05-19, 7:08 pm |
| keepyourstupidspam@yahoo.co.uk wrote:
> I have a strange build problem.
>
>
> I am building an exe, this exe links to a number of static libraries
> maybe 20 in all and all are built from my code. I am using the gmake
> build system and the MS visual studio 2003 compiler and linker.
>
>
> When I perform a completely clean build the binary builds fine to a
> size of 2900K but if i make a small code change to a cxx file and only
> perform a build that is not a complete clean build then the binary
> only
>
> builds to 2200K.
>
>
> In both cases the code builds without any errors but in the case of
> the
>
> smaller exe the program starts but just terminates pretty much in thin
> air. It Usually terminated in the instance() function of a singleton,
> this singleton is a template base class used by a few classes that I
> want to be singletons.
>
>
> I can get it to work for me if I delete only one of the .lib files the
> binary links to, it is always the same lib file, then it will build to
> 2900k without a clean build.
>
>
> This is very strange, is my build not linking to some file.
>
>
> Can anyone help me with this one?
Not sure I can help, but I observed similar behaviour when a makefile was
improperly written to use UN*X-style 'ar' command to create a static lib
from object files. The main difference was that UN*X's 'ar' _replaced_
the object module in the library, whereas Windows 'lib'/'link' _created_
another library from the object module thus losing all other objects from
the library. However, it would usually lead to errors during linking,
and you report no problems with the builds.
I would try re-creating the project (with dependencies and all) from
scratch, using only the knowledge what the build steps _should_be_.
Good luck!
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
| |
| keepyourstupidspam@yahoo.co.uk 2006-05-21, 8:11 am |
| Thanks for the reply it helped and got me thinking in a different
direction.
Here is some more information to help get to the bottom of this.
This is a scenario that I think is at the heart of the problem,
The executable links to a number of my libraries, the linkage is
static.
Library A links to library B but B also links to A. So both libs are
using functions from each other. The executible links to both A and B.
When I stop library B from linking to A and using its functions and
also remove the reference to library A in the main executable makefile
the problem goes away.
The problem is I want library B to link to lib A and visa versa.
Could this potentally be a problem or does it seem like a reasonable
use model.
Any more ideas.
Thanks again,
Enda
| |
| keepyourstupidspam@yahoo.co.uk 2006-05-24, 7:10 pm |
| Anyone else able to shed some light on this problem.
Is it possible to use dumpbin on the exe to determine what has not been
linked, how can I do this.
| |
| keepyourstupidspam@yahoo.co.uk 2006-05-25, 8:16 am |
| figured it out,
In one debug build folder I was building a component actually a lib. I
was building it as an exe and a static lib. The .lib file for the
static lib was getting overwritten by the .lib file for the exe.
Therefore when the main exe above was linking to this component i.e.
library B above some references to functions were missing.
Niow I build to two separate folders.
Enda
|
|
|
|
|