Compiling LibreCad-2.2.0.alpha on Windows 10 with Qt 4.4.1

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Compiling LibreCad-2.2.0.alpha on Windows 10 with Qt 4.4.1

mad-hatter
Hello,

With the new version of Qt, I get these errors compiling LibreCad - 2.2.0.alpha
Qt Creator 4.4.1
Based on Qt 5.9.2 (MSVC 2015, 32 bit)
gcc version 5.3.0

I don't know if its the compiler (gcc) or the source.
It compiled ok with the previous version of Qt and an earlier version of gcc.
I have to go back to  the previous version of Qt.

Regards

\librecad\src\lib\math\rs_math.cpp:305: error: no matching function for call to 'mu::Parser::DefineConst(const char [3], double)'
         p.DefineConst("pi",M_PI);
                                ^
\librecad\src\lib\math\rs_math.cpp:306: error: no matching function for call to 'mu::Parser::SetExpr(std::__cxx11::string)'
         p.SetExpr(expr_copy.toStdString());
                                          ^
\librecad\src\lib\math\rs_math.cpp:312: error: no match for 'operator<<' (operand types are 'std::ostream {aka std::basic_ostream<char>}' and 'const string_type {aka const std::__cxx11::basic_string<wchar_t>}')
         std::cout << e.GetMsg() << std::endl;
                   ^
\librecad\src\lib\math\rs_math.cpp:312: error: cannot bind 'std::ostream {aka std::basic_ostream<char>}' lvalue to 'std::basic_ostream<char>&&'
         std::cout << e.GetMsg() << std::endl;
                               ^
Reply | Threaded
Open this post in threaded view
|

Re: Compiling LibreCad-2.2.0.alpha on Windows 10 with Qt 4.4.1

qium06
I am in trouble with the same problem. My OS is win7. I use Qt Creator 4.4.1(based on Qt5.9.3).

\LibreCAD\librecad\src\lib\math\rs_math.cpp:305: error: no matching function for call to 'mu::Parser::DefineConst(const char [3], double)'
         p.DefineConst("pi",M_PI);
                                ^

\LibreCAD\librecad\src\lib\math\rs_math.cpp:306: error: no matching function for call to 'mu::Parser::SetExpr(std::__cxx11::string)'
         p.SetExpr(expr_copy.toStdString());
                                          ^

\LibreCAD\librecad\src\lib\math\rs_math.cpp:312: error: no match for 'operator<<' (operand types are 'std::ostream {aka std::basic_ostream<char>}' and 'const string_type {aka const std::__cxx11::basic_string<wchar_t>}')
         std::cout << e.GetMsg() << std::endl;
                   ^



Reply | Threaded
Open this post in threaded view
|

Re: Compiling LibreCad-2.2.0.alpha on Windows 10 with Qt 4.4.1

mad-hatter
Hello,

I never found a solution.
I went back to installing Qt 5.9.1.

Regards
Reply | Threaded
Open this post in threaded view
|

Re:Re: Compiling LibreCad-2.2.0.alpha on Windows 10 with Qt 4.4.1

qium06
Thank you! After installing Qt 5.9.1, do all those compiling problems disappear?

Best regards. 
在2017年11月27 19时09分, "mad-hattter [via LibreCAD]"<[hidden email]>写道:
Hello,

I never found the a solution.
I went back to installing Qt 5.9.1.

Regards


If you reply to this email, your message will be added to the discussion below:
http://forum.librecad.org/Compiling-LibreCad-2-2-0-alpha-on-Windows-10-with-Qt-4-4-1-tp5715344p5715502.html
To unsubscribe from Compiling LibreCad-2.2.0.alpha on Windows 10 with Qt 4.4.1, click here.
NAML


 

Reply | Threaded
Open this post in threaded view
|

Re: Compiling LibreCad-2.2.0.alpha on Windows 10 with Qt 4.4.1

qium06
In reply to this post by mad-hatter
Hello,
I find out that what causes all these errors is the conversion problem between "std::string" and "std::wstring". Maybe there are ways to set the complier to solve the problem but I don't know how to. I make a few changes to the source code involving two files and the compilation is successful.

In the file  \LibreCAD\librecad\src\lib\math\rs_math.cpp:
rs_math.cpp
Line:305
p.DefineConst(L"pi",M_PI); //   <--  p.DefineConst("pi",M_PI);
Line:306
p.SetExpr(expr_copy.toStdWString());  //   <--p.SetExpr(expr_copy.toStdString())
Line:312
std::cout << QString::fromStdWString(e.GetMsg()).toStdString() << std::endl;  // <-- std::cout << e.GetMsg() << std::endl;

In the file   \libreCAD\plugins\plotequation\plot.cpp:
Line:60~64
p.DefineConst(L"pi",M_PI);                   //<-- p.DefineConst("pi",M_PI);
p.DefineConst(L"e",M_E);                     //<-- p.DefineConst("e",M_E);
p.DefineVar(L"x", &equationVariable);        //<-- p.DefineVar("x", &equationVariable);
p.DefineVar(L"t", &equationVariable);        //<-- p.DefineVar("t", &equationVariable);
p.SetExpr(startValue.toStdWString());        //<-- p.SetExpr(startValue.toStdString());
Line:67
p.SetExpr(endValue.toStdWString());   //<-- p.SetExpr(endValue.toStdString());
Line:70
p.SetExpr(equation1.toStdWString());  //<-- p.SetExpr(equation1.toStdString());
Line:80
p.SetExpr(equation2.toStdWString());  //<-- p.SetExpr(equation2.toStdString());
Line:90
std::cout << QString::fromStdWString(e.GetMsg()).toStdString() << std::endl;  //<-- std::cout <<e.GetMsg() << std::endl;




 

Reply | Threaded
Open this post in threaded view
|

Re: Re:Re: Compiling LibreCad-2.2.0.alpha on Windows 10 with Qt 4.4.1

mad-hatter
In reply to this post by qium06
Hello,

"Thank you! After installing Qt 5.9.1, do all those compiling problems disappear?"
Not quite. Have a look here:-
http://forum.librecad.org/LibreCAD-dev-f4361976.html
You need a version of 'Boost' on your hard drive, no need to compile Boost.

Regards