Using Constructors -- LNK2019 error in Visual C++

Discussion in 'C++' started by mcarthum@gmail.com, Aug 30, 2008.

  1. Guest

    I have a class declared in a header file as follows:

    class Vector3{
    public:
    int x,y,z;
    Vector3(int inx, int iny, int inz);
    };

    And I define the class in a source file:

    class Vector3{
    public:
    int x,y,z;
    Vector3(int inx, int iny, int inz){
    x = inx;
    y = iny;
    z = inz;
    }
    };

    When I #include the header in another file and try to construct a
    Vector 3 object using "Vector3 vect(x,y,z);" I get an "unresolved
    external symbol" linker error. What might be causing this?
     
    , Aug 30, 2008
    #1
    1. Advertisements

  2. Guest

    :::WWW.MULTYINFO.COM UPDATES ::: We have just updated our website and
    added some new options such as: NEWS FROM ALL OVER THE WORLD. More
    than 157 Countries Latest News. LINK EXCHANGE and islam,business,live
    tv, play online game ,mobile and we have updated daily please vISIT
    REGULARLY Just visit at http://www.multyinfo.com
     
    , Aug 31, 2008
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sheep
    Replies:
    3
    Views:
    1,480
    Jiangsheng[Microsoft MVP of VC++]
    Aug 4, 2004
  2. Morten Aune Lyrstad

    error LNK2019

    Morten Aune Lyrstad, Aug 26, 2004, in forum: C++
    Replies:
    5
    Views:
    2,234
    Morten Aune Lyrstad
    Aug 27, 2004
  3. f rom
    Replies:
    2
    Views:
    976
    Fredrik Lundh
    Dec 5, 2006
  4. Nicros

    error LNK2019 problem

    Nicros, Nov 28, 2005, in forum: C++
    Replies:
    7
    Views:
    8,388
    Aleksei_Malkov
    Apr 10, 2008
  5. NewsGroup
    Replies:
    3
    Views:
    883
    Michael
    Oct 27, 2006
  6. girays
    Replies:
    1
    Views:
    796
  7. Trent
    Replies:
    9
    Views:
    973
    Trent
    Jun 29, 2007
  8. wiegmale

    Using a template getting LNK2019 error

    wiegmale, Jul 8, 2010, in forum: C Programming
    Replies:
    0
    Views:
    606
    wiegmale
    Jul 8, 2010
Loading...