Menu

Crashes on a Mac

J Sher
2020-05-07
2020-05-09
  • J Sher

    J Sher - 2020-05-07

    Hello,

    I have it up and running on Windows but when I send it to my mac, it compiles fine but crashes on SimpleXlsx::CWorkbook book;

    Any ideas?

    Thanks

     
  • Alexandr Belyak

    Alexandr Belyak - 2020-05-08

    Hello,

    Unfortunately, I don't have permanent access to the Mac, so I need your help.
    Can you run the program under debugger and show a screenshot with the crash point (inside the SimpleXlsx::CWorkbook constructor) and values of variables?

    Thanks

     
  • J Sher

    J Sher - 2020-05-08

    I am a mac newb but as far as I can tell it is crashing in Workbook.cpp on line 108 m_UserName = getenv( "USERNAME" );

    Seems like a permission issue or something of that nature.

    I am running Mac on a virtual machine if that makes any difference?

    Thanks,
    --James

     
  • J Sher

    J Sher - 2020-05-08

    UPDATE:

    I just commented out the line and it works. I do not know enough about a mac but it is suggested that it is because of an envirionment variable not being there issue

    --James

     
  • J Sher

    J Sher - 2020-05-08

    UPDATE: may have found the issue:
    SimpleXlsxDef line 87
    UniString & operator=( const char * other )
    {
    m_string = other; //line 87
    m_wstring = std::wstring( m_string.begin(), m_string.end() );
    return * this;
    }

     then
    
     std::string     m_string; //line 113
    
     refer to this post:
     https://stackoverflow.com/questions/5232109/access-violation-exception-while-using-getenv-to-retrieve-an-environment-variabl
    
     The error on mac I am getting is access violation.
    
     Hope im on the right track for you
    
     --James
    
     
  • Alexandr Belyak

    Alexandr Belyak - 2020-05-09

    Thank you for such complete information! You completely solved the problem :-)
    In the attachment is an updated version of the library.
    I also moved the request username from CWorkbook class constructor to function GetSystemUserName(long been a wish).

    Thanks again for your help.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.