new operator not implemented?

Help
SakirSoft
2004-10-23
2013-04-25
  • SakirSoft

    SakirSoft - 2004-10-23

    Hi

    I was trying to compile my OpenMugen project for the xbox.
    I created a make file and then compile all of my code.
    It has compiled it but at the linking it say that ther is no referenct to the new operater and the new[] operator or the delete operator.

    So i tryed to compile the samples with a new operater wich i have added to the sapmle source and the same failer apears.

    Is it my fault or isn't ther a new operator implemented??

    Sahin Vardar

     
    • Craig Edwards

      Craig Edwards - 2004-10-24

      It's not your fault at all.  I haven't added C++ support to the newlib implementation yet.  You could try getting away with something like (untested):

      void * operator new (uint_t size)
      {
          return malloc(size);
      }

      void * operator new[] (uint_t size)
      {
          return malloc(size);
      }

      void operator delete (void * p)
      {
          free(p);
      }

      void operator delete[] (void * p)
      {
          free(p);
      }

      However, you might have troubles with destructors not getting called.  I do intend to add C++ support, but at the moment, I am concentrating on getting audio support working (so many things to do, so little time :-)

      If you do manage to get it to work, please let me know. 

      --
      Craig

       
    • SakirSoft

      SakirSoft - 2004-10-25

      Thanx for you answere and you have done a good job.

      I wish you good luck for you audio implementation.

      PS. And i wish you more time ;-)

      Sahin Vardar

       

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks