Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. static CArray

static CArray

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
11 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D derhackler

    Bonjour! when i try to define a CArray as a static class member i get a link error. what's the problem, and how can i solve it? thx derhackler

    I Offline
    I Offline
    Igor Sukhov
    wrote on last edited by
    #2

    Please provide error description (or source of your class) to give us the idea of your problem. Best regards, ----------- Igor Soukhov (Brainbench/Tekmetrics ID:50759) igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru

    D 1 Reply Last reply
    0
    • I Igor Sukhov

      Please provide error description (or source of your class) to give us the idea of your problem. Best regards, ----------- Igor Soukhov (Brainbench/Tekmetrics ID:50759) igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru

      D Offline
      D Offline
      derhackler
      wrote on last edited by
      #3

      this is the code of the header file: #include class CPropertyList { public: CPropertyList(); virtual ~CPropertyList(); public: static CString fnGetADsProperty(int intArg); static CString fnGetADsProperty(CString cstrArg); static int fnGetIntProperty(CString cstrArg); static CString fnGetProperty(int intArg); static CString fnGetProperty(CString cstrArg); //Statische members static CArray cstraProperty; static CArray cstraADsProperty; static CArray intaProperty; }; this ist the error i get (for each CArray) PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A) any ideas? derhackler es ist wie es ist und es ist und es ist fürchterlich

      I 3 Replies Last reply
      0
      • D derhackler

        this is the code of the header file: #include class CPropertyList { public: CPropertyList(); virtual ~CPropertyList(); public: static CString fnGetADsProperty(int intArg); static CString fnGetADsProperty(CString cstrArg); static int fnGetIntProperty(CString cstrArg); static CString fnGetProperty(int intArg); static CString fnGetProperty(CString cstrArg); //Statische members static CArray cstraProperty; static CArray cstraADsProperty; static CArray intaProperty; }; this ist the error i get (for each CArray) PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A) any ideas? derhackler es ist wie es ist und es ist und es ist fürchterlich

        I Offline
        I Offline
        Igor Sukhov
        wrote on last edited by
        #4

        CArray is the template class - so you need to provide template parameters! Like that: class CPropertyList { ... static CArray cstraProperty; static CArray cstraADsProperty; static CArray intaProperty; }; and your always must define static variables (the code above is the declaration only!): this code your should place out of class declaration! (most of us placing this in CPP file ;) : CArray CPropertyList::cstraProperty; .. the same for others static members. Hope it'll help. #include class CPropertyList { public: CPropertyList(); virtual ~CPropertyList(); public: static CString fnGetADsProperty(int intArg); static CString fnGetADsProperty(CString cstrArg); static int fnGetIntProperty(CString cstrArg); static CString fnGetProperty(int intArg); static CString fnGetProperty(CString cstrArg); //Statische members static CArray cstraProperty; static CArray cstraADsProperty; static CArray intaProperty; }; this ist the error i get (for each CArray) PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A) any ideas? derhackler Best regards, ----------- Igor Soukhov (Brainbench/Tekmetrics ID:50759) igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru

        1 Reply Last reply
        0
        • D derhackler

          this is the code of the header file: #include class CPropertyList { public: CPropertyList(); virtual ~CPropertyList(); public: static CString fnGetADsProperty(int intArg); static CString fnGetADsProperty(CString cstrArg); static int fnGetIntProperty(CString cstrArg); static CString fnGetProperty(int intArg); static CString fnGetProperty(CString cstrArg); //Statische members static CArray cstraProperty; static CArray cstraADsProperty; static CArray intaProperty; }; this ist the error i get (for each CArray) PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A) any ideas? derhackler es ist wie es ist und es ist und es ist fürchterlich

          I Offline
          I Offline
          Igor Sukhov
          wrote on last edited by
          #5

          CArray is the template class - so you need to provide template parameters! Like that: class CPropertyList { ... static CArray cstraProperty; static CArray cstraADsProperty; static CArray intaProperty; }; and your always must define static variables (the code above is the declaration only!): this code your should place out of class declaration! (most of us placing this in CPP file ;) : CArray CPropertyList::cstraProperty; .. the same for others static members. Hope it'll help. ps: just've seen your post on codeguru ;) #include class CPropertyList { public: CPropertyList(); virtual ~CPropertyList(); public: static CString fnGetADsProperty(int intArg); static CString fnGetADsProperty(CString cstrArg); static int fnGetIntProperty(CString cstrArg); static CString fnGetProperty(int intArg); static CString fnGetProperty(CString cstrArg); //Statische members static CArray cstraProperty; static CArray cstraADsProperty; static CArray intaProperty; }; this ist the error i get (for each CArray) PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A) any ideas? derhackler Best regards, ----------- Igor Soukhov (Brainbench/Tekmetrics ID:50759) igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru

          I D 2 Replies Last reply
          0
          • D derhackler

            this is the code of the header file: #include class CPropertyList { public: CPropertyList(); virtual ~CPropertyList(); public: static CString fnGetADsProperty(int intArg); static CString fnGetADsProperty(CString cstrArg); static int fnGetIntProperty(CString cstrArg); static CString fnGetProperty(int intArg); static CString fnGetProperty(CString cstrArg); //Statische members static CArray cstraProperty; static CArray cstraADsProperty; static CArray intaProperty; }; this ist the error i get (for each CArray) PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A) any ideas? derhackler es ist wie es ist und es ist und es ist fürchterlich

            I Offline
            I Offline
            Igor Sukhov
            wrote on last edited by
            #6

            CArray is the template class - so you need to provide template parameters! Like that: class CPropertyList { ... static CArray cstraProperty; static CArray cstraADsProperty; static CArray intaProperty; }; and your always must define static variables (the code above is the declaration only!): this code your should place out of class declaration! (most of us placing this in CPP file ;) : CArray CPropertyList::cstraProperty; .. the same for others static members. Hope it'll help. ps: just've seen your post on codeguru ;) #include class CPropertyList { public: CPropertyList(); virtual ~CPropertyList(); public: static CString fnGetADsProperty(int intArg); static CString fnGetADsProperty(CString cstrArg); static int fnGetIntProperty(CString cstrArg); static CString fnGetProperty(int intArg); static CString fnGetProperty(CString cstrArg); //Statische members static CArray cstraProperty; static CArray cstraADsProperty; static CArray intaProperty; }; this ist the error i get (for each CArray) PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A) any ideas? derhackler Best regards, ----------- Igor Soukhov (Brainbench/Tekmetrics ID:50759) igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru

            1 Reply Last reply
            0
            • I Igor Sukhov

              CArray is the template class - so you need to provide template parameters! Like that: class CPropertyList { ... static CArray cstraProperty; static CArray cstraADsProperty; static CArray intaProperty; }; and your always must define static variables (the code above is the declaration only!): this code your should place out of class declaration! (most of us placing this in CPP file ;) : CArray CPropertyList::cstraProperty; .. the same for others static members. Hope it'll help. ps: just've seen your post on codeguru ;) #include class CPropertyList { public: CPropertyList(); virtual ~CPropertyList(); public: static CString fnGetADsProperty(int intArg); static CString fnGetADsProperty(CString cstrArg); static int fnGetIntProperty(CString cstrArg); static CString fnGetProperty(int intArg); static CString fnGetProperty(CString cstrArg); //Statische members static CArray cstraProperty; static CArray cstraADsProperty; static CArray intaProperty; }; this ist the error i get (for each CArray) PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A) any ideas? derhackler Best regards, ----------- Igor Soukhov (Brainbench/Tekmetrics ID:50759) igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru

              I Offline
              I Offline
              Igor Sukhov
              wrote on last edited by
              #7

              Hell, the system eats brackets ;) Best regards, ----------- Igor Soukhov (Brainbench/Tekmetrics ID:50759) igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru

              D 1 Reply Last reply
              0
              • I Igor Sukhov

                CArray is the template class - so you need to provide template parameters! Like that: class CPropertyList { ... static CArray cstraProperty; static CArray cstraADsProperty; static CArray intaProperty; }; and your always must define static variables (the code above is the declaration only!): this code your should place out of class declaration! (most of us placing this in CPP file ;) : CArray CPropertyList::cstraProperty; .. the same for others static members. Hope it'll help. ps: just've seen your post on codeguru ;) #include class CPropertyList { public: CPropertyList(); virtual ~CPropertyList(); public: static CString fnGetADsProperty(int intArg); static CString fnGetADsProperty(CString cstrArg); static int fnGetIntProperty(CString cstrArg); static CString fnGetProperty(int intArg); static CString fnGetProperty(CString cstrArg); //Statische members static CArray cstraProperty; static CArray cstraADsProperty; static CArray intaProperty; }; this ist the error i get (for each CArray) PropertyList.obj : error LNK2001: Nichtaufgeloestes externes Symbol "public: static class CArray CPropertyList::cstraProperty" (?cstraProperty@CPropertyList@@2V?$CArray@VCString@@AAV1@@@A) any ideas? derhackler Best regards, ----------- Igor Soukhov (Brainbench/Tekmetrics ID:50759) igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru

                D Offline
                D Offline
                derhackler
                wrote on last edited by
                #8

                ups. ther's something wrong with the forum code. it ignores the template parameters! :(( but i've specified the parameters like CArray[CString,CString&] (i use other brakets). so something else must be wrong.

                I 1 Reply Last reply
                0
                • I Igor Sukhov

                  Hell, the system eats brackets ;) Best regards, ----------- Igor Soukhov (Brainbench/Tekmetrics ID:50759) igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru

                  D Offline
                  D Offline
                  derhackler
                  wrote on last edited by
                  #9

                  i've seen it.:cool:

                  1 Reply Last reply
                  0
                  • D derhackler

                    ups. ther's something wrong with the forum code. it ignores the template parameters! :(( but i've specified the parameters like CArray[CString,CString&] (i use other brakets). so something else must be wrong.

                    I Offline
                    I Offline
                    Igor Sukhov
                    wrote on last edited by
                    #10

                    define the static members as I did in previouse post (some minuts ago ;) - it should help. Yes - I see the templates problem - is not a reason ! ;) Best regards, ----------- Igor Soukhov (Brainbench/Tekmetrics ID:50759) igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru

                    D 1 Reply Last reply
                    0
                    • I Igor Sukhov

                      define the static members as I did in previouse post (some minuts ago ;) - it should help. Yes - I see the templates problem - is not a reason ! ;) Best regards, ----------- Igor Soukhov (Brainbench/Tekmetrics ID:50759) igor_soukhov@yahoo.com | ICQ:57404554 | http://siv.da.ru

                      D Offline
                      D Offline
                      derhackler
                      wrote on last edited by
                      #11

                      ah!!! i see the problem. initializing the arrays is not a want - it's a must!! now my code compiles. thank you!!! es ist wie es ist und es ist fürchterlich!

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups