473,408 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Weird build problem

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

May 19 '06 #1
2 1734
* ke****************@yahoo.co.uk:

I have a strange build problem.


That's tool specific, and so (unfortunately) off-topic in clc++.

Please ask in a group dedicated to your toolset.

E.g., [microsoft.public.vc.language].
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
May 19 '06 #2
keepyourstupidspam wrote:
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.
Off-topic: VC++ pads your executable with blank segments, to prepare for the
"Edit and Continue" feature. Ask a VC++ newsgroup what's really going on.

On topic: I only use Edit and Continue for weird legacy situations, so I
always turn it off. (Because I try to always use unit tests that go directly
to a suspect point in the code, I don't need to restart and run for a long
time to get to it. So the cost of rebuilding and retesting, for me, is
always lower than the cost of Edit and Continue.)
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.


On topic: C++ does not specify the order that static-at-file-scope items
construct. And static-at-class-scope is a special case of
static-at-file-scope. So when you relink - particularily an incremental
link - you might change that order. (Internally, the order depends on stub
code in each .lib file registering your global constructors

The fix might be to construct your Singleton inside a method. Then it
constructs "before first use", which might be after the global items
construct:

Single & getSingle()
{
static Single aSingle;
return aSingle;
}

Also, don't abuse Singletons if you could replace them with a better
structure.

From here, either post platform-neutral code samples about your Singleton to
this group, or post questions about your linker and startup code to a VC++
newsgroup, for the best answers.

--
Phlip
http://c2.com/cgi/wiki?ZeekLand <-- NOT a blog!!!
May 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Martin Doyle | last post by:
Ok, I'm building a JS-based limitless-sublevel dynamic menu and am making it cross browser as well - 3 packs of aspirin so far and counting ;) I'm having a weird rendering problem using Opera...
0
by: JCauble | last post by:
1. We have a web project that has a support dll that uses the following command: HttpContext.Current.Application.ToString(); 2. In our environment we must use a build process that runs from the...
2
by: Lisa Calla | last post by:
My aspnet web was working perfectly fine, then I added a second datalist to a page. The datalist can be formatted in the designer and everything looks fine. In the codefile, I can see the...
5
by: Jim Strathmeyer | last post by:
So I'm having some weird problems with file output. If I try to boil this problem down to a small, simple program to just show what problems I'm having, I can't get the same problematic behavior. I...
1
by: Carl J. Van Arsdall | last post by:
Hey everyone, cPickle is raising an ImportError that I just don't quite understand. Before I paste the code, let me explain the application. Basically the part of the application that failed is a...
3
by: SevDer | last post by:
Hi All, I am recently experiencing a weird problem. I don't know what exactly is the cause of the problem but here is my scenario and symptoms. First of all here is my architecture 1. I have...
4
by: er | last post by:
hi, the code below generates the following behavior. cld someone please help understand it? 1) clean project + build project generates build errors (see bottom) 2) build a second time, errors...
3
by: ssecorp | last post by:
I was looking into currying and Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) on win32 Type "copyright", "credits" or "license()" for more information. ...
2
by: TamaThps | last post by:
Hi, I'm using visual studio 2008 and normally when I get an error it shows what line it is on and which file etc. The error I'm getting I don't know how to solve or even what the problem is. This...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.