×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    27

    The system can't understand the functions in other class. Pls help me!!!:eek:

    Dear all!
    I have some problem in Carbide.C++, pls help me!
    When i crate new GUI Application project and then i create new class in this project with some function.
    Then i begin use this there function by include *.h in to the other class. But when i buil or run the system display the same: "Undefined symbol: 'class CHttpClient * CHttpClient::NewL(void) (?NewL@CHttpClient@@SAPAV1@XZ)'". I just do the same in console project and everything is successfull. Please help me!

    thanks all

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: The system can't understand the functions in other class. Pls help me!!!:eek:

    The compiler/linker is almost always right.
    In this particular case it says, that you have no implementation for the method "CHttpClient * CHttpClient::NewL(void)". So make sure that you have one, and also make sure that the given .cpp file is actually referenced in the .mmp.

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    27

    Re: The system can't understand the functions in other class. Pls help me!!!:eek:

    Quote Originally Posted by wizard_hu_ View Post
    The compiler/linker is almost always right.
    In this particular case it says, that you have no implementation for the method "CHttpClient * CHttpClient::NewL(void)". So make sure that you have one, and also make sure that the given .cpp file is actually referenced in the .mmp.
    Thanks for your answer. But i can't understand your mean. Please tell me more. This is my code:
    -----------------
    //The httpexampleutils.h
    #include <e32test.h>

    class CHttpExampleUtils : public CBase {
    public:
    static void InitCommsL();
    static CHttpExampleUtils* NewL(const TDesC& aTestName);
    ~CHttpExampleUtils();
    void GetAnEntry(const TDesC& ourPrompt, TDes& currentstring);
    private:
    CHttpExampleUtils(const TDesC& aTestName);
    };
    -----------------
    //This is file implementation
    //class: HierarchicalColumnListAppUi.h
    #ifndef C_HIERARCHICALCOLUMNLISTAPPUI_H
    #define C_HIERARCHICALCOLUMNLISTAPPUI_H

    #include <aknappui.h>
    class CHierarchicalColumnListAppView;
    class CHttpExampleUtils;
    class CHierarchicalColumnListAppUi : public CAknAppUi {

    public:
    void ConstructL();
    CHierarchicalColumnListAppUi();
    ~CHierarchicalColumnListAppUi();
    void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
    void HandleCommandL( TInt aCommand );
    void HandleForegroundEventL( TBool aForeground );
    void HandleResourceChangeL( TInt aType );

    private:
    CHierarchicalColumnListAppView* iAppView;
    CHttpExampleUtils* iHttpUtil;

    };
    #endif // C_HIERARCHICALCOLUMNLISTAPPUI_H

    //Implementation
    #include "HierarchicalColumnList.pan"
    #include "HierarchicalColumnListAppUi.h"
    #include "HierarchicalColumnListAppView.h"
    #include "HierarchicalColumnList.hrh"
    #include <HierarchicalColumnList.rsg>
    #include <httpexampleutils.h>

    void CHierarchicalColumnListAppUi::ConstructL()
    {
    iHttpUtil = CHttpExampleUtils::NewL(_L("ABCD"));

    }

    And this is error message:
    Undefined symbol: 'class CHttpExampleUtils * CHttpExampleUtils::NewL(class TDesC16 const &) (?NewL@CHttpExampleUtils@@SAPAV1@ABVTDesC16@@@Z)'

    . But when i do the same in Consol application this build successfull.

    -------------------------------------------

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: The system can't understand the functions in other class. Pls help me!!!:eek:

    Quote Originally Posted by dinhtrungac View Post
    //The httpexampleutils.h
    Based on that I would expect that you also have httpexampleutils.cpp. Is it copied to your GUI project?

    Hmm... By the way "my code", "when i do the same in Consol application", etc.: httpexampleutils.h and .cpp are in Examples\AppProts\exampleclient. And when "you" do the same in console application, it works, because
    Quote Originally Posted by Examples\AppProts\exampleclient\httpexampleclient.mmp
    SOURCE HttpExampleClient.cpp HttpExampleUtils.cpp
    the given example is referring HttpExampleUtils.cpp, just as I suggested in my previous post.

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    27

    Re: The system can't understand the functions in other class. Pls help me!!!:eek:

    Quote Originally Posted by wizard_hu_ View Post
    Based on that I would expect that you also have httpexampleutils.cpp. Is it copied to your GUI project?

    Hmm... By the way "my code", "when i do the same in Consol application", etc.: httpexampleutils.h and .cpp are in Examples\AppProts\exampleclient. And when "you" do the same in console application, it works, becausethe given example is referring HttpExampleUtils.cpp, just as I suggested in my previous post.
    Thanks alot of and sorry for my misapprehension. Because i'm a newbie, this the first times i'm working on symbian platform with Carbide.C++. You can help me more detail? Thanks you so much.

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: The system can't understand the functions in other class. Pls help me!!!:eek:

    You have to copy HttpExampleUtils.cpp into your project (preferably to the src folder) if you have not done so.
    Then you should make sure that HttpExampleUtils.cpp appears in your .mmp file, next to a SOURCE keyword (if you open the .mmp file, you will see a place where various SOURCE-s are referred, that is the place you should add this one).
    Carbide may ask about adding the file to the .mmp when you copy it into the project.

  7. #7
    Registered User
    Join Date
    May 2009
    Posts
    27

    Re: The system can't understand the functions in other class. Pls help me!!!:eek:

    Quote Originally Posted by wizard_hu_ View Post
    You have to copy HttpExampleUtils.cpp into your project (preferably to the src folder) if you have not done so.
    Then you should make sure that HttpExampleUtils.cpp appears in your .mmp file, next to a SOURCE keyword (if you open the .mmp file, you will see a place where various SOURCE-s are referred, that is the place you should add this one).
    Carbide may ask about adding the file to the .mmp when you copy it into the project.
    Thanks you so much. with your help, this issue are done. the my first example are build and run successfull.

Similar Threads

  1. Cannot create class in system package
    By rooster13 in forum Mobile Java General
    Replies: 7
    Last Post: 2007-09-29, 17:19
  2. Replies: 2
    Last Post: 2007-03-14, 17:15
  3. System Help with nokia pc connectivity SDK
    By gotka in forum PC Suite API and PC Connectivity SDK
    Replies: 4
    Last Post: 2004-07-06, 09:56
  4. "Cannot create class in system package" on 6610
    By LanguageBug in forum Mobile Java General
    Replies: 7
    Last Post: 2003-11-02, 18:47
  5. cannot create class in system package
    By natrixnt in forum Mobile Java General
    Replies: 6
    Last Post: 2003-08-05, 08:47

Posting Permissions

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