C++ Static variable and unresolved externals error

后端 未结 2 978
隐瞒了意图╮
隐瞒了意图╮ 2020-12-12 06:34

I was hoping I could get some clarification on static variables of a class.

For example: I have two different classes which perform completely different functions,

2条回答
  •  囚心锁ツ
    2020-12-12 07:10

    Add this to main.cpp:

    beta  alpha::var;
    

    var in h-file is only type declaration. Variable should be created in some source file.

提交回复
热议问题