When I declare a class variable as global, linker gives that error. As far as I understand cstartup code calls a function that calls that constructors but that implementation is missing..
What should I include?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
When I declare a class variable as global, linker gives that error. As far as I understand cstartup code calls a function that calls that constructors but that implementation is missing..
What should I include?
Sure..
class Foo
{
public:
Foo();
int delta;
};
Foo::Foo()
{
delta = 5;
}
Foo foo;
int main()
{
}
If I move Foo foo; into main(), the problem goes away. From the name I understand that cstart_call_ctors, calls constructors before main.. That is missing in the libraries..
Ok, I think I found the problem.. When I created the project I didn't pay attention which template I used.. Creating new project by selecting C++ template explicitly fixed the problem.. That's interesting though..