C++ Qt static QList of class pointers to keep track of siblings? -


मैं thisClass (QObject inherits) उदाहरण ("भाई बहन") का ट्रैक रखना चाहूंगा "साझा" स्थैतिक कक्षा के सदस्य के लिए यह (स्वयं को सूचक) जोड़ना: <पूर्व> निजी: स्थिर QList & lt; thisClass * & gt; _plist;

हालांकि, स्थिर सदस्य घोषणा एक एलएनके 2001 अनसुलझे बाहरी प्रतीक का कारण बनता है। स्थिर के बिना, प्रोग्राम बनाता है (लेकिन प्रत्येक ऑब्जेक्ट का केवल अपना डेटा होता है)।

क्या त्रुटि का कारण हो सकता है, कोई फ़िक्स है, और कैसे " उदाहरण "ठीक से किया जाना है?

आपने स्थैतिक सदस्य को घोषित किया है। अब आपको सीपीपी फ़ाइल में इसे परिभाषित करने की आवश्यकता है:

QList & lt; thisClass * & gt; thisClass :: _ plist;

Comments

Popular posts from this blog

asp.net - Procedure or function "Procedure name" expects a parameter "Param name" which was not supplied occurs rarely -

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -

c++ - Redefined variable in the other module -