Click here to Skip to main content
15,913,027 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to Merge two or more CImageList objects to a single one Pin
Mark Salsbery16-Mar-08 7:53
Mark Salsbery16-Mar-08 7:53 
GeneralRe: How to Merge two or more CImageList objects to a single one Pin
georgekjolly16-Mar-08 19:03
georgekjolly16-Mar-08 19:03 
GeneralRe: How to Merge two or more CImageList objects to a single one Pin
Mark Salsbery17-Mar-08 5:49
Mark Salsbery17-Mar-08 5:49 
GeneralCall MS ACCESS from dialog. Pin
Andrey2215-Mar-08 7:46
Andrey2215-Mar-08 7:46 
AnswerRe: Call MS ACCESS from dialog. Pin
Rajesh R Subramanian15-Mar-08 8:27
professionalRajesh R Subramanian15-Mar-08 8:27 
GeneralRe: Call MS ACCESS from dialog. Pin
Andrey2215-Mar-08 9:25
Andrey2215-Mar-08 9:25 
GeneralRe: Call MS ACCESS from dialog. Pin
David Crow15-Mar-08 15:25
David Crow15-Mar-08 15:25 
Generalstatic "hell" Pin
dontknowitall15-Mar-08 6:31
dontknowitall15-Mar-08 6:31 
Let's say I have the following:

---- Start .lib ----
class A
{
...
};

class B
{
public:
B();
int Func3();

static int Func1();
static int Func2();
};

class C
{
public:
static int Func1();
};
---- End .lib ----

---- Start .exe ----
...

int main()
{
C::Func1();
}
---- End .exe ----

This is the simplest example of the problem. C::Func1() calls B::Func1(). B::Func1() executes code but DOES NOT instantiate class A, call B::Func2(), or instantiate any instance of B(). B::Func2() instantiates an instance of A and B. I have all Visual Studio 2008 compiler optimizations turned on that I can find (/GL, /Ox, /GF, /OPT:REF, /OPT:ICF, /ltcg).

Yet, when using a static disassembler, I can clearly see that just because I reference one static function in a class (B::Func1()), even though the other static functions in the class are not used (B::Func2()), that code is included, which in turn makes any classes they use get included (e.g. class A), and then those functions include classes they use.... The end result is an unnecessarily _huge_ executable. As I said, this is just a simple example.

As far as I can tell, this is a "bug" that has been in VS since VS.NET. The only thing I can think of to possibly solve this is to create a class for each and every static function in the code...but that will likely take weeks to complete. Any better suggestions other than that?

And it would be really nice if anyone here could confirm that this is actually a bug in VS.

modified on Saturday, March 15, 2008 12:41 PM

GeneralRe: static "hell" Pin
_808615-Mar-08 6:57
_808615-Mar-08 6:57 
GeneralRe: static "hell" Pin
dontknowitall15-Mar-08 7:15
dontknowitall15-Mar-08 7:15 
GeneralRe: static "hell" Pin
_808615-Mar-08 7:29
_808615-Mar-08 7:29 
GeneralRe: static "hell" Pin
dontknowitall15-Mar-08 8:32
dontknowitall15-Mar-08 8:32 
QuestionRe: static "hell" Pin
CPallini15-Mar-08 7:52
mveCPallini15-Mar-08 7:52 
GeneralRe: static "hell" Pin
dontknowitall15-Mar-08 8:19
dontknowitall15-Mar-08 8:19 
GeneralRe: static "hell" Pin
CPallini15-Mar-08 9:19
mveCPallini15-Mar-08 9:19 
GeneralRe: static "hell" Pin
dontknowitall15-Mar-08 9:35
dontknowitall15-Mar-08 9:35 
GeneralRe: static "hell" Pin
CPallini16-Mar-08 3:49
mveCPallini16-Mar-08 3:49 
GeneralRe: static "hell" Pin
Member 75496018-Mar-08 2:42
Member 75496018-Mar-08 2:42 
Generalplz urgent!!! Pin
AbdullahTheGreat15-Mar-08 5:41
AbdullahTheGreat15-Mar-08 5:41 
AnswerRe: plz urgent!!! Pin
Rajesh R Subramanian15-Mar-08 5:44
professionalRajesh R Subramanian15-Mar-08 5:44 
GeneralRe: plz urgent!!! Pin
marcio kovags15-Mar-08 9:21
marcio kovags15-Mar-08 9:21 
GeneralAdd Project into workspace Error Pin
bala_potty15-Mar-08 4:57
bala_potty15-Mar-08 4:57 
GeneralRe: Add Project into workspace Error Pin
Rajkumar R15-Mar-08 10:07
Rajkumar R15-Mar-08 10:07 
GeneralRe: Add Project into workspace Error Pin
bala_potty16-Mar-08 0:08
bala_potty16-Mar-08 0:08 
AnswerRe: Add Project into workspace Error Pin
Rajkumar R16-Mar-08 21:41
Rajkumar R16-Mar-08 21:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.