C ++ common Undefined symbols for architecture * And undefinedsymbols

Source: Internet
Author: User

C ++ common Undefined symbols for architecture * And undefinedsymbols

Appears

Undefined symbols for architecture x86_64:

Cause

1. The function is declared, but not defined.

2. The declared virtual function is not implemented.

NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.

3. Use template <class T> to implement the class. If you write the function declaration in A. H file, write it in. cpp. The Undefined symbols for architecture x86_64 is displayed. Declarations and implementations should be placed in. H files

Template <class T> class Heap {typedef typename vector <T>: iterator; private: vector <T> container; void swim (int I ); void sink (int I) ;}; template <class T> void Heap <T >:: swim (int I) {while (I> 1 & container [I]> container [I/2]) {T temp = container [I]; container [I] = container [I/2]; container [I/2] = temp; I = I/2 ;}}

Http://www.cnblogs.com/like1/p/6848669.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.