×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jun 2004
    Location
    Helsinki, Finland
    Posts
    38

    Can't get around "Program is not a recognized executable" when trying to debug my app

    I am developing an application for S60, using Carbide.c++ v1.2.2 and the S60 3rd Edition, Maintenance Release SDK.

    I imported the project from a bld.inf that refers to two .mmp files, using only the "Emulator Debug (WINSCW)" configuration. I compiled the whole project successfully. The only warnings displayed in the console window are about unused function parameters in a couple of functions, and the following:

    Code:
    mwldsym2.exe: warning: Multiply defined section: _memmove in
    mwldsym2.exe: warning: files mem.c.obj (MSL_All_MSE_Symbian_D.lib), euser.dll (MyAppEngine.lib),
    mwldsym2.exe: warning: keeping definition in euser.dll
    mwldsym2.exe: warning: Multiply defined section: _memcpy in
    mwldsym2.exe: warning: files mem.c.obj (MSL_All_MSE_Symbian_D.lib), euser.dll (MyAppEngine.lib),
    mwldsym2.exe: warning: keeping definition in euser.dll
    mwldsym2.exe: warning: Multiply defined section: _memset in
    mwldsym2.exe: warning: files mem.c.obj (MSL_All_MSE_Symbian_D.lib), euser.dll (MyAppEngine.lib),
    mwldsym2.exe: warning: keeping definition in euser.dll
    I now try to debug it, by pressing the debug button on the top row of the C++ perspective (the button whose icon looks like an insect).

    What happens is that the perspective changes to the debug perspective, and a dialog pops up, with the title "Launching" and the text:

    Program is not a recognized executable.


    When I click on the "Details" button, I see the same text repeated three times. Very helpful.

    (The error message could certainly be clearer. What program? Does it refer to my own application, or to epoc.exe, or to some other program, unknown to me? Error messages should attempt to give the maximum possible information, so that the user can drill down on the problem as quickly as possible. How hard would it be to give the name of the program or command that is objectionable to Carbide.c++ (along with any command-line parameters, of course)?)

    I tried to google to find out if others had encountered this problem. I found pages such as http://leiresearch.wordpress.com/200...in-on-windows/ and http://eclipse-plugins.2y.net/eclips...0&firstItem=51 that suggest to me that I should do the following:

    "Project Properties" -> "C/C++ Make Project" -> "Binary Parser", then Check only PE Windows Parser


    Now, when I right-click on the project in the C/C++ Projects window, and select properties, a dialog pops up, with several categories in the left-hand pane: "Info", "Builders", "C/C++ Documentation", "C/C++ File Types", "C/C++ Include Paths and Symbols", "C/C++ Indexer", "C/C++ Project Paths", "Carbide Build Configurations", "Carbide Project Settings", "Carbide Rom Build Settings", and "Project References". However, there is no "C/C++ Make Project", and I can find no reference in any of the categories to a parser, binary or otherwise.

    Elsewhere on the net (at http://publib.boulder.ibm.com/infoce...roj_parser.htm), I find advice that tells me to select "Window" -> "Preferences", which opens another settings dialog. Here, I find the category "C/C++" -> "Make" -> "Makefile Editor" -> "New Make Projects", and in that category, tab "Binary Parser". Now we're getting somewhere.

    There are several parsers listed here, with a checkbox to their left. The only one that is checked is "Elf Parser". I tried the following: I unchecked "Elf Parser" and checked "PE Windows Parser", as the web page says. I saved the settings. Since this setting concerns new projects, I deleted my project, and just to make sure the new project will be produced from a completely clean slate, I exited Carbide.c++, deleted directory %epcoroot%epoc32/BUILD, and restarted Carbide.c++. I verified that the Binary Parser setting was what I had just set it to.

    I then reimported my project from the same bld.inf file as before, again using only the "Emulator Debug (WINSCW)" configuration, rebuilt everything successfully, and pressed the Debug button again. The same problem occurred again: a dialog pops up, saying "Program is not a recognized executable."

    (When I deleted my project, imported a new one from \Symbian\9.1\S60_3rd_MR\S60Ex\helloworldbasic\group\bld.inf, built it, and tried to run it, I did not get this error. Instead, in the debug perspective, I could see that the IDE started to run the emulator. I then was prompted to register my SDK because a time limit of some kind had expired, but that's a separate matter. So, the problem must be something specific to my project.)

    Does anybody have any idea about what I should try next?
    Last edited by leisti; 2007-12-12 at 02:39. Reason: clarity

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

    Re: Can't get around "Program is not a recognized executable" when trying to debug my

    Can you post the .mmp file?

  3. #3
    Registered User
    Join Date
    Jun 2004
    Location
    Helsinki, Finland
    Posts
    38

    Re: Can't get around "Program is not a recognized executable" when trying to debug my

    Quote Originally Posted by wizard_hu_ View Post
    Can you post the .mmp file?
    Here's the bld.inf file that refers to the .mmp files, and the two .mmp files.

    Sorry for the paranoia, but because it's commercial software, I've disguised some of the identifiers: I've replaced the real application name by MyApp; I've renamed the source code filenames in MyAppEngine.mmp, and for brevity, am only showing one (renamed) source file per directory, anyway; and for brevity, have shortened the list of .bmp files in MyAppUi.mmp. (Almost certainly, none of the hidden things bear on the problem I'm encountering.)

    As you'll note, I'm not using the traditional Symbian scheme of putting all .cpp files in directory src/ and all .h files in directory inc/. Instead, I've lumped them all together in code/, just to make things a bit easier for myself. This makes no difference for building the application.

    bld.inf:
    Code:
    /* bld.inf */
    
    PRJ_PLATFORMS
    WINSCW GCCE
    
    PRJ_MMPFILES
    
    ..\Ui\group\MyAppUi.mmp
    ..\Engine\group\MyAppEngine.mmp
    MyAppUi.mmp:
    Code:
    /* MyAppUi.mmp */
    
    TARGET                  MyAppUi.exe
    TARGETTYPE              EXE
    UID                     0x100039CE 0xE3DDD0C4 //!! are these OK? reserve UIDs from Symbian Ltd.
    VENDORID                0 // if no security checks are needed, VENDORID can remain 0
    LANG                    01
    CAPABILITY              NONE //!! might have to add some capabilities
    
    
    // include paths
    SYSTEMINCLUDE           \epoc32\include
    
    USERINCLUDE             ..\code
    USERINCLUDE             ..\data
    USERINCLUDE             ..\..\Common
    USERINCLUDE             ..\..\Engine\code
    
    
    // the main resources
    START RESOURCE          ..\data\MyApp.rss
    HEADER
    LANG                    01
    TARGETPATH              resource\apps
    END
    
    
    // the registration resource
    START RESOURCE          ..\data\MyApp_reg.rss
    TARGETPATH              \private\10003a3f\apps
    END
    
    
    // graphics
    START BITMAP            myapp.mbm
    TARGETPATH              .\resource\apps
    HEADER
    SOURCEPATH              ..\gfx
    SOURCE                  c8,1  logo_50x50.bmp logo_mask_50x50.bmp
    SOURCE                  c8,1  logo_70x70.bmp logo_mask_70x70.bmp
    SOURCE                  1     empty_18x18.bmp
    SOURCE                  1     empty_34x34.bmp
    SOURCE                  1     mask_18x18.bmp
    SOURCE                  1     mask_34x34.bmp
    SOURCE                  c8    A_18x18.bmp
    SOURCE                  c8    A_34x34.bmp
    // the rest of the bitmaps deleted for brevity (they're not the problem)
    END
    
    
    // source code
    SOURCEPATH              ..\code
    SOURCE                  CMobUiApplication.cpp
    SOURCE                  CMobUiAppUi.cpp
    SOURCE                  CMobUiBaseListboxView.cpp
    SOURCE                  CMobUiBaseListboxViewContainer.cpp
    SOURCE                  CMobUiDocument.cpp
    SOURCE                  CMobUiMainView.cpp
    SOURCE                  CMobUiMainViewContainer.cpp
    SOURCE                  CMobUiExtensionsView.cpp
    SOURCE                  CMobUiExtensionsViewContainer.cpp
    
    
    // our own engine
    LIBRARY                 MyAppEngine.lib
    
    
    // system libraries needed
    LIBRARY                 aknnotify.lib
    LIBRARY                 aknicon.lib
    LIBRARY                 apparc.lib
    LIBRARY                 avkon.lib
    LIBRARY                 bafl.lib
    LIBRARY                 commonengine.lib
    LIBRARY                 cone.lib
    LIBRARY                 ecom.lib
    LIBRARY                 efsrv.lib
    LIBRARY                 egul.lib
    LIBRARY                 eikcoctl.lib
    LIBRARY                 eikcore.lib
    LIBRARY                 eikctl.lib
    LIBRARY                 eikdlg.lib
    LIBRARY                 esock.lib
    LIBRARY                 estor.lib
    LIBRARY                 etext.lib
    LIBRARY                 euser.lib
    LIBRARY                 fbscli.lib
    LIBRARY                 gdi.lib
    LIBRARY                 http.lib
    LIBRARY                 inetprotutil.lib
    LIBRARY                 insock.lib
    
    DEBUGLIBRARY            flogger.lib // file logger
    MyAppEngine.mmp:
    Code:
    /* MyAppEngine.mmp */
    
    TARGET                  MyAppEngine.lib
    TARGETTYPE              LIB
    UID                     0x00000000 0xEC65C8EA //!! are these OK? reserve UIDs from Symbian Ltd.
    SECUREID                0xEBE04E33            //!! are these OK? reserve UIDs from Symbian Ltd.
    VENDORID                0 // if no security checks are needed, VENDORID can remain 0
    LANG                    01
    CAPABILITY              NetworkServices
    
    SYSTEMINCLUDE           \epoc32\include
    //SYSTEMINCLUDE           \epoc32\include\variant
    //SYSTEMINCLUDE           \epoc32\include\ecom
    
    USERINCLUDE             ..\code
    USERINCLUDE             ..\code\Events
    USERINCLUDE             ..\code\Requests
    USERINCLUDE             ..\code\Responses
    USERINCLUDE             ..\..\Common
    USERINCLUDE             ..\..\Ui\code
    
    // source code
    
    SOURCEPATH              ..\code
    SOURCE                  CSourceFile_1.cpp
    // others deleted for brevity
    
    SOURCEPATH              ..\code\Events
    SOURCE                  CSourceFile_2.cpp
    // others deleted for brevity
    
    SOURCEPATH              ..\code\Requests
    SOURCE                  CSourceFile_3.cpp
    // others deleted for brevity
    
    SOURCEPATH              ..\code\Responses
    SOURCE                  CSourceFile_4.cpp
    // others deleted for brevity
    
    SOURCEPATH              ..\..\Common
    SOURCE                  CSourceFile_5.cpp
    
    // libraries needed !! but surely not all these?
    LIBRARY                 avkon.lib
    LIBRARY                 bafl.lib
    LIBRARY                 charconv.lib
    LIBRARY                 commonengine.lib
    LIBRARY                 cone.lib
    LIBRARY                 ecom.lib
    LIBRARY                 efsrv.lib
    LIBRARY                 egul.lib
    LIBRARY                 eikcoctl.lib
    LIBRARY                 esock.lib
    LIBRARY                 estor.lib
    LIBRARY                 etext.lib
    LIBRARY                 euser.lib
    LIBRARY                 fbscli.lib
    LIBRARY                 http.lib
    LIBRARY                 inetprotutil.lib
    LIBRARY                 insock.lib
    
    DEBUGLIBRARY            flogger.lib // file logger

  4. #4
    Registered User
    Join Date
    Jun 2004
    Location
    Helsinki, Finland
    Posts
    38

    Re: Can't get around "Program is not a recognized executable" when trying to debug my

    I've struggled further with this problem today. First of all, I replaced the following lines of MyAppEngine.mmp:

    Code:
    TARGET                  MyAppEngine.lib
    TARGETTYPE              LIB
    UID                     0x00000000 0xEC65C8EA //!! are these OK? reserve UIDs from Symbian Ltd.
    SECUREID                0xEBE04E33            //!! are these OK? reserve UIDs from Symbian Ltd.
    with the following:

    Code:
    TARGET                  MyAppEngine.dll
    TARGETTYPE              DLL
    UID                     0x1000008D 0xEC65C8EA //!! 0xE* UIDs are for development purposes.  Reserve a real UID.
    UID3 will function as the SECUREID if the latter is not defined, so SECUREID is not needed.

    For static DLLs, UID2 must be 0x1000008D.

    After these changes, the build process didn't generate the file MyAppEngine.lib which MyAppUi needed to link to it. The error is:

    Code:
    make[1]: *** No rule to make target
    `\Symbian\9.1\S60_3rd_MR\EPOC32\RELEASE\WINSCW\UDEB\MyAppEngine.lib',
    needed by `\Symbian\9.1\S60_3rd_MR\EPOC32\RELEASE\WINSCW\UDEB\MyAppUi.exe'.
    Stop.
    So, I commented out the line LIBRARY MyAppEngine.lib from MyAppUi.mmp, then rebuilt everything successfully, and was then able to start the emulator without getting the "Program is not a recognized executable" error.

    Now, still I needed to get the MyAppEngine.lib file generated, so I can link to it from MyAppUi. That proved to be somewhat difficult. By my understanding, MyAppEngine.lib should automatically be created if the .mmp file's TARGET is MyAppEngine.dll. That, however, was not the case, so I faffed around, trying different things. I tried adding the line EXPORTUNFROZEN to MyAppEngine.mmp. I tried exporting the .def file from the engine using the statement DEFFILE ./IpfxMobilityEngine.def. I tried lots of stuff, but nothing got MyAppEngine.lib generated.

    I then thought of going back to having the target type to be LIB, but keeping UID2 as 0x1000008D. That got everything built, but now, I again get the "Program is not a recognized executable" error when I try to run the emulator.

    Can anyone see what I'm doing wrong?

  5. #5
    Registered User
    Join Date
    Jun 2004
    Location
    Helsinki, Finland
    Posts
    38

    Re: Can't get around "Program is not a recognized executable" when trying to debug my

    I found the solution.

    I wrote:
    I've struggled further with this problem today. First of all, I replaced the following lines of MyAppEngine.mmp:

    Code:
    TARGET                  MyAppEngine.lib
    TARGETTYPE              LIB
    UID                     0x00000000 0xEC65C8EA //!! are these OK? reserve UIDs from Symbian Ltd.
    SECUREID                0xEBE04E33            //!! are these OK? reserve UIDs from Symbian Ltd.
    with the following:

    Code:
    TARGET                  MyAppEngine.dll
    TARGETTYPE              DLL
    UID                     0x1000008D 0xEC65C8EA //!! 0xE* UIDs are for development purposes.  Reserve a real UID.
    So, that took care of the original "Program is not a recognized executable" problem. The issue was UID2, which should be set to the type of DLL in question; in this case "0x1000008D" for a static DLL. (I wonder if it would be too much to ask Symbian to have some sort of a keyword for this, or to deduce the information from the TARGETTYPE, so one wouldn't have to look up obscure codes? And if not, I wonder if 4,294,967,296 potential file types isn't a bit of an overkill?)

    The remaining problem was that no matter what I tried, the build process didn't create MyAppEngine.lib, so MyAppUi couldn't be built, because it needed the former.

    The solution, when I found it, was one of those slap-your-forehead moments: I simply needed to switch the order of the .mmp files in bld.inf. That file originally was:

    Code:
    /* bld.inf */
    
    PRJ_PLATFORMS
    WINSCW GCCE
    
    PRJ_MMPFILES
    ..\Ui\group\MyAppUi.mmp
    ..\Engine\group\MyAppEngine.mmp
    And after I changed the last two files to:

    Code:
    ..\Engine\group\MyAppEngine.mmp
    ..\Ui\group\MyAppUi.mmp
    and built from the command line, everything was built.

    However, when I originally used the Carbide.c++ SDK, it built both components, even though the UI was before the engine in bld.inf, so one would think it would have produced MyAppEngine.lib, too. Anyway, after I transposed the lines, the SDK built the app, too.

  6. #6
    Registered User
    Join Date
    Jun 2008
    Posts
    17

    Exclamation Re: Can't get around "Program is not a recognized executable" when trying to debug my

    I've get similar behaviour (but in my case I can see the compiled executable in the right place).
    After searching for reason a little, I found that:

    1) in Project Properties -> Carbide Project Settings -> Debug Target MMP
    was selected a wrong mmp file (I have several in my application, was used one of library-files)
    2) Because of (1) in the Run or Debug configuration (visible if click on Run - > Run...) was set a wrong executable (in my case some part of epoc)

    Note: if you change (1), you should check also (2) because it may be not updated automatical.

    But the Thread-Author is right: it could be better to see, which executable is not recognized ;-)

    Andrey

Similar Threads

  1. How to debug telephony app from emulator?
    By xuyang in forum General Development Questions
    Replies: 0
    Last Post: 2003-06-12, 19:12
  2. the "messages" crashed when my app return
    By dt10000 in forum Symbian
    Replies: 0
    Last Post: 2003-05-29, 09:16
  3. 7650 - go back, close my app not closing the container app
    By geran in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2002-12-05, 10:00
  4. 7650 - go back, close my app not closing the container app
    By geran in forum Digital Rights Management & Content Downloading
    Replies: 1
    Last Post: 2002-12-05, 09:58
  5. Launching an app from pJava..
    By krajag in forum PersonalJava
    Replies: 0
    Last Post: 2002-10-10, 19:57

Posting Permissions

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