Compile error under Windows in current develop revision

Issue #546 resolved
Former user created an issue

Currently, compiling a fresh checkout with mingw under Windows 64bit gives the following error:

compiling ../../../../src/libs/qmuparser/qmuparsertest.cpp
compiling ../../../../src/libs/vpropertyexplorer/vserializedproperty.cpp
..\..\..\..\src\libs\qmuparser\qmuparsertest.cpp: In member function 'int qmu::Test::QmuParserTester::TestInfixOprt()':
..\..\..\..\src\libs\qmuparser\qmuparsertest.cpp:696:33: error: 'M_PI' was not declared in this scope
     iStat += EqnTest ( "-_pi", -M_PI, true );
                                 ^
..\..\..\..\src\libs\qmuparser\qmuparsertest.cpp: In static member function 'static int qmu::Test::QmuParserTester::EqnTest(const QString&, double, bool)':
..\..\..\..\src\libs\qmuparser\qmuparsertest.cpp:1293:52: error: 'M_PI' was not declared in this scope
         p1->DefineConst ( "pi", static_cast<qreal>(M_PI) );
                                                    ^
..\..\..\..\src\libs\qmuparser\qmuparsertest.cpp:1294:51: error: 'M_E' was not declared in this scope
         p1->DefineConst ( "e", static_cast<qreal>(M_E) );
                                                   ^
Makefile:1178: recipe for target 'obj/qmuparsertest.o' failed
mingw32-make[3]: *** [obj/qmuparsertest.o] Error 1
mingw32-make[3]: Leaving directory 'C:/LW_D/MinGW-Projects/Valentina/build/src/libs/qmuparser'
Makefile:50: recipe for target 'sub-qmuparser-make_first' failed
mingw32-make[2]: *** [sub-qmuparser-make_first] Error 2
mingw32-make[2]: *** Waiting for unfinished jobs....

Comments (11)

  1. Holger Pandel

    Hey Roman! I created a pull request and hopefully it is ok what I've done... With these changes everything works so far.

    EDIT: Question: I should have surrounded my defines with Q_OS_WIN additionally???

  2. Holger Pandel

    I don't understand, what this has to do with my PATH variable, because it never changed since my first successful compilation months ago... And regarding qmath.h, from what I understand, systematically this would have to be used anywhere instead of math.h, right? As I told you before, I'm not deep enough into C++ to decide such things.

    I just thought, that if, on Windows, a somewhat official solution could be used here, it is the way to go. If you, as your programming experience is light years further than mine, decide to go a more general (in this particular situation, more OS-independent) but (for me) complicated way, then please decline my pull request and I'm totally fine with it, for sure!

    Sadly, I wont be of any help, then, because I won't be the one to decide which *.h to use and where...

    https://msdn.microsoft.com/de-de/library/4hwaceh6.aspx

  3. Roman Telezhynskyi repo owner

    I don't understand, what this has to do with my PATH variable, because it never changed since my first successful compilation months ago...

    I just wanna be sure your path is right. I know enough examples when in one case compiler can find header and in other not. Also your case is very strange for me because i check my code on appveyor.com and it was builded succesfully.

    I don't understand, what this has to do with my PATH variable

    For example math.h is inside C:\Qt\Qt5.4.0\5.4\mingw491_32\include. and this path should be theoretically in PATH variable. Maybe this is reason why it can't find it. But for example appveyor.com succesfully build without it.

    And regarding qmath.h, from what I understand, systematically this would have to be used anywhere instead of math.h, right?

    Yes, looks like.

    I just thought, that if, on Windows, a somewhat official solution could be used here, it is the way to go. If you, as your programming experience is light years further than mine, decide to go a more general (in this particular situation, more OS-independent) but (for me) complicated way, then please decline my pull request and I'm totally fine with it, for sure!

    Your solution works on Windows. But i am not satisfied about it. Yes, i want more OS-independent way. Especially because we need keep supporting Qt 5.0.

    Sadly, I wont be of any help, then, because I won't be the one to decide which *.h to use and where...

    But your issue showed problems i still have in the code. Even if it compiles in some cases.

  4. Holger Pandel

    That's exactly what I meant: you are l i g h t y e a r s ahead ;-) I would have never known that these small changes solve the whole thing! You're great, many thanks for that!

  5. Log in to comment