Yet another unresolved external symbol error.

Posted on 2006-03-23
Last Modified: 2010-04-01
Thought I had it sorted and then this new error came up....and its yet another of these unresolved external symbol errors.
Is there a way of finding out what they mean and how to fix it.....have had a few of these errors and all seem to have a different solution...
PLEASE HELP!!! again...

coursework error LNK2019: unresolved external symbol "public: void __thiscall shape_utils::draw_all<class std::vector<class Shape *,class std::allocator<class Shape *> > >(class std::vector<class Shape *,class std::allocator<class Shape *> > const &)" (??$draw_all@V?$vector@PAVShape@@V?$allocator@PAVShape@@@std@@@std@@@shape_utils@@QAEXABV?$vector@PAVShape@@V?$allocator@PAVShape@@@std@@@std@@@Z) referenced in function _main

The shape_utils is one of my own classes and it's part of my project and I've already set precompiled headers to off.
Have also checked that the method signature is exactly the same in the header and cpp file.
It's also a template method...  

Hope this info helps...
Question by:benoost123
    LVL 86

    Expert Comment

    What's the declaration and where does the implementation reside? It should be in the same file as the implementation.

    Author Comment

    template <typename Container>
    void draw_all(const Container& con);

    it's declared in shape_utils.h and the implementation is in shape_utils.cpp
    LVL 86

    Accepted Solution

    Move the implementation to the header file. VC++ does not support separating them into a .cpp file.

    Author Comment

    Have done it...... IT WORKS!   (or at least it compiles for now.... :-) )
    Thanks very much jkr!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Article by: SunnyDark
    This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
      Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
    The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
    The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now