×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Sep 2007
    Location
    Noida, India
    Posts
    67

    Giving multiply defined section error

    Hi All,

    I have a made one header file . when I include it on AppUi calss it is not giving any error. But when I include it more than one place in my project(different classes ) It giving an error like this:



    mwldsym2.exe: Multiply defined section: void MyFileClose(void) (?MyFileClose@@YAXXZ) in
    mwldsym2.exe: files EyeWatchAppUi.o, EyeWatchAppView.o
    mwldsym2.exe: Multiply defined section: void MyFileOepn(void) (?MyFileOepn@@YAXXZ) in
    mwldsym2.exe: files EyeWatchAppUi.o, EyeWatchAppView.o
    mwldsym2.exe: Multiply defined section: void MyFileConstruct(void) (?MyFileConstruct@@YAXXZ) in
    mwldsym2.exe: files EyeWatchAppUi.o, EyeWatchAppView.o
    mwldsym2.exe: Multiply defined section: void MyFileLogger(void) (?MyFileLogger@@YAXXZ) in
    mwldsym2.exe: files EyeWatchAppUi.o, EyeWatchAppView.o
    mwldsym2.exe: Multiply defined section: void MyFileDoWrite(void) (?MyFileDoWrite@@YAXXZ) in
    mwldsym2.exe: files EyeWatchAppUi.o, EyeWatchAppView.o
    mwldsym2.exe: Multiply defined section: void MyFileWrite(class TDesC8 const &) (?MyFileWrite@@YAXABVTDesC8@@@Z) in
    mwldsym2.exe: files EyeWatchAppUi.o, EyeWatchAppView.o
    mwldsym2.exe: Multiply defined section: void MyFileWrite(class TDesC16 const &) (?MyFileWrite@@YAXABVTDesC16@@@Z) in
    mwldsym2.exe: files EyeWatchAppUi.o, EyeWatchAppView.o
    mwldsym2.exe: Multiply defined section: void MyFileWrite(class TRefByValue<class TDesC8 const >, ...) (?MyFileWrite@@YAXV?$TRefByValue@$$CBVTDesC8@@@@ZZ) in
    mwldsym2.exe: files EyeWatchAppUi.o, EyeWatchAppView.o
    mwldsym2.exe: Multiply defined symbol: class RFs iMyFs (?iMyFs@@3VRFs@@A) in
    mwldsym2.exe: files EyeWatchAppUi.o, EyeWatchAppView.o
    mwldsym2.exe: Multiply defined symbol: class RFile iMyFile (?iMyFile@@3VRFile@@A) in
    mwldsym2.exe: files EyeWatchAppUi.o, EyeWatchAppView.o
    mwldsym2.exe: Multiply defined symbol: class TBuf8<2000> iMyFileLogBuffer (?iMyFileLogBuffer@@3V?$TBuf8@$0HNA@@@A) in
    mwldsym2.exe: files EyeWatchAppUi.o, EyeWatchAppView.o


    Please help me ....
    Thanks in Advance.
    Thanks & Regards,

    Avinash

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

    Re: Giving multiply defined section error

    I guess it is not really a header file.

    Header file contains declarations:
    Code:
    typedef x y;
    void donothing(void);
    class Z ...;
    extern int number;
    Definitions should be in .c, .cpp files
    Code:
    void donothing(void)
    {
        nothing;
    }
    
    int Z::five()
    {
        return 5;
    }
    
    int number;
    So do not provide definitions in the class declaration.

  3. #3
    Registered User
    Join Date
    Sep 2007
    Location
    Noida, India
    Posts
    67

    Re: Giving multiply defined section error

    Hi Wizard,

    we can aslo define a function in header file. like inline function. can you tell me one thing why this header file is working fine while i include one times in project?
    Thanks & Regards,

    Avinash

  4. #4
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,033

    Re: Giving multiply defined section error

    something similar was discussed here : http://www.developer.nokia.com/Commu...ion-definition

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,694

    Re: Giving multiply defined section error

    Quote Originally Posted by avinash_ji View Post
    we can aslo define a function in header file. like inline function.
    Yes, I know. That makes two of us.
    can you tell me one thing why this header file is working fine while i include one times in project?
    Because you might be doing something else, not inline functions. Anyway, check the discussion suggested by Vineet.

Similar Threads

  1. Error -> mwldsym2.exe: Multiply defined section:
    By SymbianTH in forum Open C/C++
    Replies: 7
    Last Post: 2009-09-21, 14:23
  2. Error: Multiply defined section
    By sathiyapriyanm in forum Symbian
    Replies: 8
    Last Post: 2009-03-13, 07:00
  3. Replies: 19
    Last Post: 2009-01-23, 06:20
  4. multiply defined section
    By mukesh_r_solanki in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 4
    Last Post: 2008-07-17, 09:19
  5. Multiply Defined Section...HELP !!
    By salmanmanekia in forum Symbian
    Replies: 3
    Last Post: 2008-04-09, 09:02

Posting Permissions

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