Compiler error

This is a discussion on Compiler error within the C++ Programming forums, part of the General Programming Boards category; Code: $ g++ -c -lX11 -I /usr/include/cairo -lcairo src/TopLevelWindow.cpp src/TopLevelWindow.cpp: In constructor ‘TopLevelWindow::TopLevelWindow(Application*, Dimension, std::string)’: src/TopLevelWindow.cpp:3: error: no matching function ...

  1. #1
    MTK
    MTK is offline
    Registered User
    Join Date
    Aug 2009
    Posts
    198

    Compiler error

    Code:
    $ g++ -c -lX11 -I /usr/include/cairo -lcairo src/TopLevelWindow.cpp
    src/TopLevelWindow.cpp: In constructor ‘TopLevelWindow::TopLevelWindow(Application*, Dimension, std::string)’:
    src/TopLevelWindow.cpp:3: error: no matching function for call to ‘Widget::Widget()’
    src/Widget.h:18: note: candidates are: Widget::Widget(Widget*, Dimension, Dimension)
    src/Widget.h:9: note:                 Widget::Widget(const Widget&)
    I'm not quite sure what this means, but it looks to me that it's complaining that TopLevelWindow doesn't have the same constructors as its base class. How do I fix this?

  2. #2
    Registered User
    Join Date
    Feb 2009
    Posts
    40
    Probably because you are trying to make a Widget variable without to initialize it with don't with don't have a default constructor. Look up initialization lists

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how do you resolve this error?
    By -EquinoX- in forum C Programming
    Replies: 32
    Last Post: 11-05-2008, 04:35 PM
  2. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 02:17 PM
  3. error: template with C linkage
    By michaels-r in forum C++ Programming
    Replies: 3
    Last Post: 05-17-2006, 09:11 AM
  4. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  5. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 07:39 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21