H
Harald Deischinger
I am using a source file with the following style (I know it is not
very beautiful but it is working):
SRC1.cpp:
static void vFoo() {
// bla bla bla
}
static int iInit1(name, fun) {
// access some global variables to register fun as name.
}
static int _tmp1 = iInit1("void", vFoo);
Please not that this example is very simplified. In the real example
for some data types functions are listed in a global data strucuture
so that they can be found by name.
This is working fine a long is in SRC1.cpp there is a least one other
function that is called from a different source file. But if that is
missing it seems that the whole source file is removed from the
resulting application. The initialization functions are not called.
And it is not possible to set a breakpoint in any of the functions.
Any ideas what might cause this "optimization"?
The linker option /opt:noref does not help.
harald
very beautiful but it is working):
SRC1.cpp:
static void vFoo() {
// bla bla bla
}
static int iInit1(name, fun) {
// access some global variables to register fun as name.
}
static int _tmp1 = iInit1("void", vFoo);
Please not that this example is very simplified. In the real example
for some data types functions are listed in a global data strucuture
so that they can be found by name.
This is working fine a long is in SRC1.cpp there is a least one other
function that is called from a different source file. But if that is
missing it seems that the whole source file is removed from the
resulting application. The initialization functions are not called.
And it is not possible to set a breakpoint in any of the functions.
Any ideas what might cause this "optimization"?
The linker option /opt:noref does not help.
harald