C ++ compiler error --- member function definition redefinition error in the .h file (Error LNK 2005)

 

 

  Today wrote a simple class definition in the .h file, it will be very simple class member functions defined in the (behind class category) together. Run time appears as shown compilation error (error LNK2005)

  Find information, most of them are said to prevent the need to add #pragma once redefined, but I had just added, and obviously not the problem. Delay a moment, I thought I could put into function implementation cpp file to try, really put in enough to make a cpp.

 

Guess you like

Origin www.cnblogs.com/chen9510/p/10951688.html