473,785 Members | 2,878 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1758
* 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.publi c.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
keepyourstupids pam 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
2585
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 7.51, even though it displays fine in Mozilla 1.6, Firefox 0.9, Netscape 7.1 and Internet Explorer 6.0 Hope someone can help!
0
1124
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 command line to get things into production, not the IDE. The problem. When we compile the project in the IDE everything works great, the application works the support DLL gets the current context stuff and everything is just fine. However...
2
1531
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 datalist after me. and intellesense works for the control datalist2. Build\Rebuild all reports a failure, but does not specify the errors. Running the page results in a message box 'There were build errors. Would you like to continue and run the last...
5
2368
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 have a function: bool Tourist::CreateMaps() { debug.Out() << "Tourist::CreateMaps" << std::endl; std::ofstream out((player_name + ".sav").c_str(),std::ios::out); std::string ms = Random::MapStart();
1
1373
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 function that loads a list of objects from a file using cPickle. This list is a queue of requests. I've done some research and it looks like cPickle tries to load some modules as some kind of test. From what I can tell the module that cPickle...
3
3621
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 a main framework (DNN) build in VB.NET which I try to prevent changing things there (simply not changing it) 2. I have a virtual directory under this which I develop in C#.
4
1620
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 disappears, run: ok 3) uncomment and comment , no problem 4) uncomment and , also no problem #ifndef A_IMPL_H_
3
1629
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. **************************************************************** Personal firewall software may warn about the connection IDLE makes to its subprocess using this computer's internal loopback interface. This connection is not visible on any external interface and no data is sent to...
2
1974
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 is the whole output when I try to run the program. "1>------ Build started: Project: corysid, Configuration: Debug Win32 ------ 1>Compiling... 1>implementation.cpp 1>Linking... 1>actualmain.obj : error LNK2019: unresolved external symbol "public:...
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8974
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7500
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.