Menu

MathGL - problem with running applications compiled in Visual Studio 2013

Anonymous
2014-04-09
2014-06-26
  • Anonymous

    Anonymous - 2014-04-09

    Dear Alexey,

    I would like to ask you for your help again. I conduct scientific project where we use MathGL. I must use Visual Studio 2013 in this project. Thanks to your support I can already compile and install MathGL using Visual Studio 2013. I can also compile my program which uses MathGL. Unfortunately the program crashes when I run it. The interesting thing is that when I use Visual Studio 2012 everything is perfectly OK (I checked it on other machine with Visual Studion 2012 installed).

    I was trying to find out the problem for a while. Finally I found out that exactly the same problem occurs if I try to run any of the examples from MathGL manual. Any example crashes when the MathGL library and the example itself are compiled in VS 2013. Everything is fine when both are compiled in VS 2012.

    Could you please look at the problem and help me? I would be very grateful for any help.

    Best regards,
    Wojciech Sankowski

    P.S.

    The simplest example I try to run looks as follows:

    int main(int argc, char argv[]) {
    mglGraph gr;
    gr.FPlot("sin(pi
    x)");
    return 0;
    }

    This example crashes with the following information:

    Unhandled exception at 0x5875270B (mgl.dll) in ...
    Stack overflow (parameters: 0x00000001, 0x00212FFC).

     
  • Alexey Balakin

    Alexey Balakin - 2014-04-09

    Dear Wojciech,

    I'm afraid what I couldn't help you with this. I have no VisualStudio to test it. And I have only rather old and slow computer with WindowsXP (Pentium4 if you remember it), which can be used only for basic tests. So, could you provide me more information about this problem? Or could you ask anybody else about it (for example, in http://groups.google.com/group/mathgl)?

    Kind regards,
    Alexey Balakin

     
  • Anonymous

    Anonymous - 2014-04-09

    Dear Alexey,

    Below I am sending what I have found.

    When I debug the example program I reach function:

    void mglCanvas::line_plot(long p1, long p2)

    Inside this function there is instruction:
    d = hypot(Pnt[p1].x-Pnt[p2].x, Pnt[p1].y-Pnt[p2].y);

    The program reaches this instruction and goes into infinite loop in which the instruction _hypot is executed. This finally causes stack to overflow.

    I hope it will help you to track the problem. I would be very grateful for any help.

    Best regards,
    Wojciech Sankowski

     
  • Anonymous

    Anonymous - 2014-04-09

    Dear Alexey,

    I managed to overcome the problem!

    I commented out the following line in file include\mgl2\define.h:

    define hypot _hypot

    After this change everything works fine in the debug mode!

    I would be very grateful if you could fix it permanently in the repository.

    Best regards,
    Wojciech Sankowski

     
  • Alexey Balakin

    Alexey Balakin - 2014-04-10

    Can you give me value of _MSC_VER for VisualStudio 2013? So, that I exclude this define only for newest VisualStudio version(s). Also can you check if other functions (strtoull, getcwd, chdir, snprintf) are present or absent in VisualStudio 2013?

     
  • Anonymous

    Anonymous - 2014-04-10

    Dear Alexey,

    Answering your questions:
    1) The predefined macro _MSC_VER In Visual Studio 2013 is:
    _MSC_VER = 1800

    2) Which functions are present in VS 2013 is specified in the attached file. Please be aware that I can only check whether the MathGL compiles or not. I do not run any functional tests.

    Best regards,
    Wojciech Sankowski

     
  • Alexey Balakin

    Alexey Balakin - 2014-04-11

    Thank you. I'll add this in closest svn commit.

     
  • Anonymous

    Anonymous - 2014-04-11

    Dear Alexey,

    Great, please let me know when these changes are committed. I will test them and let you know if everything works fine in my project.

    Best regards,
    Wojciech Sankowski

     
  • Alexey Balakin

    Alexey Balakin - 2014-04-12

    Dear Wojciech,

    it is already done in SVN rev.947.

    Best regards,
    Alexey Balakin

     
  • Anonymous

    Anonymous - 2014-04-14

    Dear Alexey,

    I checked current revision and everything works fine. Now I can compile MathGL in Visual Studio 2013 and my project executes correctly and produces the expected charts.

    Thank you very much for your help.

    Best regards,
    Wojciech Sankowski

     
    • Anonymous

      Anonymous - 2014-06-25

      Dear Wojciech,

      I realized you have been successful in building MathGl with VS 2013. I have been trying to do the same with no success. I will be glad if you can share your building steps with me.

      Regards,
      Felix Kotey

       
  • Anonymous

    Anonymous - 2014-06-26

    Dear Wojciech,

    Could you please give me some instruction on how to compile MathGL in VS2012? I am trying to compile it:
    in Windows 7 64bit, use CMake 2.8.9 GUI, set the folder of source code to be
    mathgl-code-1018\mathgl-2x

    I use the QT 4.8.3, after generating done, I opened the MathGL.sln and compile it, hundreds of following similar errors displayed:

    error C3861: 'fmin': identifier not found

    Is there anything I missed?

    Thanks,
    Tang Laoya

     

Anonymous
Anonymous

Add attachments
Cancel