0

I have a peculiar case where some code in a .cpp file that is not actually used by the rest of the project seems to be excluded from the build. However, the is important enough. Is there some way - short of making some arbitary function call into the .cpp file - to make sure that this code gets included by the ? (or any pointers to why it may be excluded would be helpfull)

I have tried to expose the struct in a .h file to satisfy the linker - but this was not enough.

Using with and also .

//init.cpp
#include "Pch.h"    
//#pragma init_seg(lib)

struct Init {
  Init(){std::cout << "in Init"<< std::endl ;}
}

Init init;
darune
  • 10,480
  • 2
  • 24
  • 62

0 Answers0