Menu

#3 Testing Source Code and CMake under new MS Visual Studio

1.0
wont-fix
Testing (1)
2017-01-18
2014-10-26
No

Discussion

  • Clemens Geyer

    Clemens Geyer - 2014-10-26
    • labels: --> Testing
     
  • Saranya Balasubramanian

    1. GENERATING VS SOLUTION FILES:
      Initially Cmake is not able to identify C and C++ compiler, and needs to be manually set (I am using Visual Studio Express 2013, Compiler VS 12.0). Once I do that (by adding CMAKE_C_COMPILER and CMAKE_CXX_COMPILER with values set to the filepath cl.exe), the solution files are neatly generated.

    2.BUILDING THE PROJECT
    The visual studio compiler overrides std's max and min functions (used in muparser). One of the least instrusive solutions is to include "#define NOMINMAX". I understand that the compiler has to see this before including the windows headers - but I don't know where I should put this to make it work.
    Another way is to include "#include <algorithm>" in all these files:
    1. mpFuncCommon.cpp
    2. mpRPN.cpp
    3. mpTest.cpp
    This is messier, as muparser is an external library - so I have not checked this in even though it works.


     
    • Clemens Geyer

      Clemens Geyer - 2014-10-30
      1. That seems to be a bug in CMake and should actually not be the case. Unfortunately, I cannot test it at the moment, but am also interested to see the behavior. Maybe we have to set an environmental variable in Windows so that it works correctly. Maybe http://www.cmake.org/Bug/view.php?id=12410 is talking about the same issue.
      2. This is also a strange behavior because there were no issues with muParser in VS 2010. Windows.h is only inculded in test_main.cpp and just needed for the different colors. If it causes troubles, it may be better to remove it. A possible workaround is described on http://stackoverflow.com/questions/13416418/define-nominmax-using-stdmin-max (either creating paranthesis around the min-max functions or setting the flag globally in the compiler).
       

      Last edit: Clemens Geyer 2014-10-30
  • Saranya Balasubramanian

    Reg 2. I get compiler errors in mpFuncCommon.cpp, mpRPN.cpp, and mpTest.cpp saying min andmax functions are not members of std. I'll try your suggestion in matrix.h tomorrow and update.

     
  • Clemens Geyer

    Clemens Geyer - 2017-01-18

    Done - we agreed to ignore VS6/98 for future releases. Cmake should be leveraged to create according project files.

     
  • Clemens Geyer

    Clemens Geyer - 2017-01-18
    • status: open --> wont-fix
     

Log in to post a comment.