Problem with System::out

Bel Od
  • Bel Od

    Bel Od - 2004-06-16

    Can you help get me started with the following code.  I don't seem to be able to run the following code.  I use Visual C++ 6.0, I created a project with an executable to run in a DOS window.  When I run in I get "Runtime Error!" "abnormal program termination". When I activate the cout statements, those work.  The problem seems to be with the System::out->println statement.



    // PartMessageBasic.h
    //#include <iostream.h>
    //#include <stdlib.h>
    #include <acdk.h>
    #include <acdk/lang/System.h>

    // defining RPartMessageBasic, PartMessageBasicArray and RPartMessageBasicArray

    class PartMessageBasic : public acdk::lang::Object {    

    int main(int argc, char *argv[]){
        //cout << "1 BEGIN Part Message Basic.\n";
        RString str = "RUNNING Part Message Basic.";
        //cout << str;
        //cout << "2 END Part Message Basic.\n";
           return 0;

    • Roger Rene Kommer


      You have to call the acdk::lang::System::main(...) function:

      // alternatally use a static class method
      int yourmain(RStringArray args)
        // begin here

      main(int argc, char* argv[], char** envptr)
        return acdk::lang::System::main(yourmain, argc, argv, envptr);

      This is necessary, because inside the System::main System::out, threading, memory management and other stuff will be initialized.

      For a starting template you can also use the acdk_boot sample, with a sample dll and executable.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks