Menu

how to gnatbind with -M option on Solaris

Olmec
2008-01-11
2012-09-15
  • Olmec

    Olmec - 2008-01-11

    Hi,
    i have downloaded and installed version 4.2.2 for solaris 10.
    my ada program will call c objects and i need to change the "main".
    After compilation, while binding, i get an error message. i have listed my comp. steps and output below

    $ gnatmake -c hello.adb
    >gcc -c hello.adb
    $ gnatbind -x -Mnew_main hello.ali
    >gnatbind: -M not expected to be used on native platforms
    >error: "hello.ali" does not contain a unit that can be a main program

    The code is simple

    with text_io;
    procedure hello is
    begin
    text_io.put("Hello world");
    end hello;

    Any idea?

     
    • Martin Krischik

      Martin Krischik - 2008-01-11

      While on "Open Discussion" nothing of off-topic you are still at the wrong place - as the Wiki states "Programming and product support is done by the PartnerProjects." - for your question that would be "http://gcc.gnu.org/".

      Apart from that - why use 2 commands if one command can do so as well:

      gnat make hello.adb

      will do it all for you.

      Martin

       
    • Jeffrey Creem

      Jeffrey Creem - 2008-01-11

      You may want questions like this to go to comp.lang.ada for a wider audience. I would also suggest gnat make as Martin did but you seem to indicate you wanted to modify the main generated by gnatbind and I wonder why you think you need to do that.

      Normally one just pragma imports and calls things from the right place in the Ada code. Is this some very complicated interaction between elaboration Ada code and an underlying C library? Even if it is you may want to rethink if you are going forward with the right approach as going down a path where you edit the main is obviously non-portable and certainly somewhat confusing.

       

Log in to post a comment.