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

c# - Roxy file manager in MVC doesn't accept session path -

jsp - No mapping found for HTTP request with URI with annotation config Spring MVC and Jetty -

java - Ajax call to jsp and jsp redirecting to further jsp -