×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    22

    Undefined reference to E32Main

    Hi,

    While porting an application to 3rd edition, i bumped into that weird issue.
    In function `$p': symaehabi\Callfirstprocessfn.cpp.text+0x48): undefined reference to `E32Main()'

    My E32Main() function looks like that:
    GLDEF_C TInt E32Main()
    {
    return EikStart::RunApplication(NewApplication);
    }
    It is compiled in a static library (.lib) and my exe application is linked against that library.
    However, if i move my E32Main() function from the library to the exe code, it works all fine.
    To test, i put the E32Main() function in both my exe and my lib and then i have a:
    (.text+0xf4): multiple definition of `E32Main()'

    What the hell is going on there?

  2. #2
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: Undefined reference to E32Main

    hi,

    Hope This will clear u...
    Code:
    Application Entry Point
    Instead of the S60 2nd Edition application entry point:
    
    GLDEF_C TInt E32Dll( TDllReason )
    
        {
    
        return KErrNone;
    
        }
     
    
    In S60 3rd Edition, EXE applications need an E32Main() function as an entry point. The application is started using the RunApplication method from eikstart.h.
    
    #ifdef __SERIES60_30__
    
    #include <eikstart.h>
    
    #endif
    
    É
    
    #ifdef __SERIES60_30__
    
    GLDEF_C TInt E32Main()
    
          {
    
          return EikStart::RunApplication( NewApplication );
    
          }
    
    # else
    
    GLDEF_C TInt E32Dll( TDllReason )
    
        {
    
        return KErrNone;
    
        }
    
    #endif
    Source taken from SDk documentation....
    Regards,
    Mateen Maldar
    "Whatever the mind can conceive and believe, the mind can achieve"

  3. #3
    Super Contributor
    Join Date
    May 2006
    Location
    Beijing,China
    Posts
    1,190

    Re: Undefined reference to E32Main

    #include <eikstart.h>

  4. #4
    Registered User
    Join Date
    Jun 2006
    Posts
    22

    Re: Undefined reference to E32Main

    Well yes. I saw that. And i think it's exactly what i am doing. If the entrypoint is in a static library, and my exe linked to that library, then it should find the entrypoint and link all fine. Am i wrong about that?
    It's like on 2nd edition, if E32Dll() is in the library, it works fine.

    I have my E32Main() in the library, and i can't see any good reason why the linker doesn't find it when linking the exe with the library.
    My exe code is supposed to be platform independant, so i should not HAVE TO put the entrypoint in the exe code but only in the library code...

    And #include <eikstart.h> is included, i would have a compiler error if i didn't have it included, it's a linker error i'm getting here.

    Additionnaly, it looks like armv5 target did link it (it even did it for real, just tried the application on the device.. ).. Sounds like some of those odd library link order issues to me. However, i applied the patch which is supposed to fix it already. Any suggestion about it because i'd like to have it working with gcce as well?
    Last edited by damsku; 2006-08-23 at 14:08.

  5. #5
    Registered User
    Join Date
    Jul 2008
    Posts
    16

    Re: Undefined reference to E32Main

    Quote Originally Posted by damsku View Post
    Well yes. I saw that. And i think it's exactly what i am doing. If the entrypoint is in a static library, and my exe linked to that library, then it should find the entrypoint and link all fine. Am i wrong about that?
    It's like on 2nd edition, if E32Dll() is in the library, it works fine.

    I have my E32Main() in the library, and i can't see any good reason why the linker doesn't find it when linking the exe with the library.
    My exe code is supposed to be platform independant, so i should not HAVE TO put the entrypoint in the exe code but only in the library code...

    And #include <eikstart.h> is included, i would have a compiler error if i didn't have it included, it's a linker error i'm getting here.

    Additionnaly, it looks like armv5 target did link it (it even did it for real, just tried the application on the device.. ).. Sounds like some of those odd library link order issues to me. However, i applied the patch which is supposed to fix it already. Any suggestion about it because i'd like to have it working with gcce as well?
    Did you ever figure out how to make the linker recognize the staticlibrary definition of your E32Main?

Similar Threads

  1. 3rd edition: undefined reference
    By iulian_moldovan in forum Symbian
    Replies: 2
    Last Post: 2006-06-20, 14:11
  2. Replies: 5
    Last Post: 2006-05-31, 07:23
  3. Replies: 4
    Last Post: 2006-05-11, 10:03
  4. static data member gives undefined reference error
    By cmalu in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2004-11-30, 16:56
  5. undefined reference to CTrapCleanup::New()
    By dhsymb in forum Symbian
    Replies: 0
    Last Post: 2004-01-15, 12:37

Posting Permissions

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