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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Error at compiling virtual function call in constructor

Error at compiling virtual function call in constructor

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
6 Posts 4 Posters 2 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.
  • V Offline
    V Offline
    vgrigor
    wrote on last edited by
    #1

    I want to call pure virtual function in constructor of BASE class, function will be defined in derived class. class Derived: class Base { firtual void f() {}; } template class Base { Base() { f(); }; firtual void f() =0; }; Error at link; How to correct? Thanks

    T T 2 Replies Last reply
    0
    • V vgrigor

      I want to call pure virtual function in constructor of BASE class, function will be defined in derived class. class Derived: class Base { firtual void f() {}; } template class Base { Base() { f(); }; firtual void f() =0; }; Error at link; How to correct? Thanks

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      what error does it really give a link-time?

      TOXCCT >>> GEII power

      1 Reply Last reply
      0
      • V vgrigor

        I want to call pure virtual function in constructor of BASE class, function will be defined in derived class. class Derived: class Base { firtual void f() {}; } template class Base { Base() { f(); }; firtual void f() =0; }; Error at link; How to correct? Thanks

        T Offline
        T Offline
        Tomasz Sowinski
        wrote on last edited by
        #3

        Check this: http://www.parashift.com/c++-faq-lite/strange-inheritance.html#faq-23.3[^] Tomasz Sowinski -- http://www.shooltz.com

        signature has expired

        V N 2 Replies Last reply
        0
        • T Tomasz Sowinski

          Check this: http://www.parashift.com/c++-faq-lite/strange-inheritance.html#faq-23.3[^] Tomasz Sowinski -- http://www.shooltz.com

          signature has expired

          V Offline
          V Offline
          vgrigor
          wrote on last edited by
          #4

          as rarely as good reply.

          1 Reply Last reply
          0
          • T Tomasz Sowinski

            Check this: http://www.parashift.com/c++-faq-lite/strange-inheritance.html#faq-23.3[^] Tomasz Sowinski -- http://www.shooltz.com

            signature has expired

            N Offline
            N Offline
            Nemanja Trifunovic
            wrote on last edited by
            #5

            Welcome back, Tomasz :cool:

            T 1 Reply Last reply
            0
            • N Nemanja Trifunovic

              Welcome back, Tomasz :cool:

              T Offline
              T Offline
              Tomasz Sowinski
              wrote on last edited by
              #6

              Thanks, Nemanja. I was just passing by and had a look at good ol' VC board :) Tomasz Sowinski -- http://www.shooltz.com

              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