Re: /target is 'exe' but no suitable main method was found in compilation

From: Alex K. Angelopoulos [MVP] (aka-at-mvps-dot-org)
Date: 06/07/04

  • Next message: Lars-Inge Tønnessen: "Re: Please thiHelp"
    Date: Mon, 7 Jun 2004 13:40:36 -0500
    
    

    Mary wrote:
    > Can someone tell me what this error means in J# /target is 'exe' but
    > no suitable main method was found in compilation

    Console executables (which are compiled with the commandline parameter
    /target:exe) need to have an entry point function declared, usually done as
    follows:

    public static void main(String[] args)
    {
     // code that calls stuff goes here
    }

    Most likely one of the following is your problem:

    + Your main is not declared as public static void or is missing

    + The compiler can't find the main entry point due to having multiple
    classes; in that case:
     - If using the commandline compiler you need to also use the option
    /main:<class> where <class> is the name of the class containing your desired
    entry point function;
     - If using the Visual Studio IDE, go to the Project menu and choose the
    <projectname> Properties item from the bottom of the menu; under General
    enter the name of the class containing the entry point.

    + You accidentally set the target type incorrectly - /target:exe is only for
    console executables. If you meant to have a different type of project:
    - if using the commandline compiler, use the appropriate argument instead:
    /target:winexe, /target:library, or /target:module;
    - if using VS, in the project properties under General change Output Type to
    the correct type.


  • Next message: Lars-Inge Tønnessen: "Re: Please thiHelp"

    Relevant Pages

    • Re: R: GOBACK (was: Perform Thru/Go to vs. Perform - Compile Speed
      ... >>in a toy program using a single compiler on just one platform. ... and ANS'2002 and not to something that _isn't_ 'modernized Cobol'. ... > existing Cobol program to run paragraphs in parallel requires changing at least ... > one paragraph name to ENTRY, or breaking the program into smaller ones. ...
      (comp.lang.cobol)
    • Re: Perform Thru/Go to vs. Perform - Compile Speed
      ... Microfocus Level II Cobol has ENTRY but no recursion. ... > never read the Standard. ... criteria was 'whatever extensions the MF and Fujitsu compiler did' ... A good compiler, whose weaknesses are ... ...
      (comp.lang.cobol)
    • ENTRY Linkage Editor/Binder (was: Variable Length Files
      ... "ENTRY" as an IBM link-edit statement DOES relate to the ENTRY ... If you compile with the (LE-conforming COBOL) ... > I've never actually compiled using the IBM compiler procs, ...
      (comp.lang.cobol)
    • Re: ENTRY statement
      ... subroutine at its two different entry points. ... In some struct sense it is true that the standard does ... strange things with memory as long as they follow the requirements of ... compiler you will ever see. ...
      (comp.lang.fortran)
    • Re: Symbol tables and scopes
      ... Using one symbol table and making each entry potentially a stack is ... actually described in the literature (1978 Compiler Construction ... scope records can be made on a developer-by-developer basis. ...
      (comp.compilers)

    Loading