×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Sep 2006
    Location
    Beijing, China
    Posts
    386

    class constructor error

    What's the compiler trying to tell me?

    Code:
    GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=131005
    ..\\src\\Interactiveappui.cpp: In member function
            `virtual void CInteractiveAppUi::ConstructL()':
    ..\\src\\Interactiveappui.cpp:32: error: no matching function for call to
            `CInteractiveContainer::CInteractiveContainer()'
    ..//inc/InteractiveContainer.h:36: note: candidates are: 
           CInteractiveContainer::CInteractiveContainer(const CInteractiveContainer&)
    ..\\src\\Interactiveappui.cpp:32 is :
    Code:
    iAppContainer = new (ELeave) CInteractiveContainer;
    and there is no constructor defined for class CInteractiveContainer.

    I have very similar code in both the Container.h and appui.cpp files in a different project, but it doesn't seem to have this trouble. However, there are many other files that are different between the projects. Is this something to do with 'new'?

  2. #2
    Regular Contributor
    Join Date
    Feb 2004
    Posts
    99

    Re: class constructor error

    Can you define the constructor for CInteractiveContainer?

  3. #3
    Registered User
    Join Date
    Sep 2006
    Location
    Beijing, China
    Posts
    386

    Re: class constructor error

    Quote Originally Posted by kiranpuranik
    Can you define the constructor for CInteractiveContainer?
    Yes, but there wasn't one in my other project and that compiles just fine.

    I could try, I suppose, but it doesn't sound like the correct solution...I'll have a go.

  4. #4
    Regular Contributor
    Join Date
    May 2007
    Posts
    463

    Re: class constructor error

    If you have no defined constructor, you only get an implicit constructor if the base class has an parameterless constructor too. I'd hazard a guess that your base class needs explicit construction.
    Get Resolvr - The Zeroconf framework for Symbian OS free today. Make your IP networking applications fun and easy to use. http://www.novelinteractions.com/resolvr/
    Proud to be the only autorickshaw owner in Cambridge - http://blog.novelinteractions.com/images/tuktuk.jpg

  5. #5
    Registered User
    Join Date
    Sep 2006
    Location
    Beijing, China
    Posts
    386

    Re: class constructor error

    Quote Originally Posted by cdavies-nokia
    If you have no defined constructor, you only get an implicit constructor if the base class has an parameterless constructor too. I'd hazard a guess that your base class needs explicit construction.
    We found the problem...you were close

    The class had a data member that was of a class whose constructor needed a value as a parameter...and I wasn't giving it one.

    Obscure, eh?

Similar Threads

  1. External Linking Error (Undefined Symbol)
    By nile_mail in forum Symbian
    Replies: 2
    Last Post: 2008-08-05, 13:10
  2. Linking Error(Undefined Symbol)
    By nile_mail in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 10
    Last Post: 2008-03-26, 23:32
  3. need information about j2me polish
    By rathikathangaraj in forum Mobile Java General
    Replies: 4
    Last Post: 2007-12-19, 09:01
  4. 21 errors in j2me , help in soving them
    By abhishek_1211 in forum General Messaging
    Replies: 0
    Last Post: 2006-04-01, 09:04
  5. Exceptions while loading application
    By avinash_rs in forum Mobile Java General
    Replies: 0
    Last Post: 2003-06-09, 10:53

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×