|
Hello,
OS Windows 10
Download:-
LibreCAD-2.2.0-alpha-122-g93a23f6_source
Qt About:-
Qt Creator 4.5.2
Based on Qt 5.10.1 (MSVC 2015, 32 bit)
gcc version 5.3.0
To get a clean compile.
With shadow build on. (debug and release build ok, after these mods)
In custom.pro add:- (or your version of Boost and its location, no need to compile)
...
#** **
BOOST_DIR = "C:/boost/boost_1_66_0/"
BOOST_LIBDIR = "C:/boost/boost_1_66_0/libs/"
#** **
...
Change the following:-
muParserToken.h:72
std::auto_ptr<ParserCallback> m_pCallback;
^
muParserBase.h:291
std::auto_ptr<token_reader_type> m_pTokenReader;
^
Change std::auto_ptr to std::unique_ptr, first compile you get more issues, change just these two, they all refer to the same lines.
In plot.cpp change the following:- (as suggested by @qium06)
void plot::execComm(Document_Interface *doc, QWidget *parent, QString cmd)
{
...
try{
mu::Parser p;
//** ** p.DefineConst("pi",M_PI);
p.DefineConst(L"pi",M_PI);
//** ** p.DefineConst("e",M_E);
p.DefineConst(L"e",M_E);
//** ** p.DefineVar("x", &equationVariable);
p.DefineVar(L"x", &equationVariable);
//** ** p.DefineVar("t", &equationVariable);
p.DefineVar(L"t", &equationVariable);
//** ** p.SetExpr(startValue.toStdString());
p.SetExpr(startValue.toStdWString());
startVal = p.Eval();
//** ** p.SetExpr(endValue.toStdString());
p.SetExpr(endValue.toStdWString());
endVal = p.Eval();
//** ** p.SetExpr(equation1.toStdString());
p.SetExpr(equation1.toStdWString());
for(equationVariable = startVal; equationVariable < endVal; equationVariable += stepSize)//end value is not used!
{//calculate the values of the first equation
xValues.append(equationVariable);
yValues1.append(p.Eval());
}
if(!equation2.isEmpty())
{//calculate the values of the second equation
//** ** p.SetExpr(equation2.toStdString());
p.SetExpr(equation2.toStdWString());
for(int i = 0; i < xValues.size(); ++i)
{
equationVariable = xValues.at(i);
yValues2.append(p.Eval());
}
}
}
catch (mu::Parser::exception_type &e)
{
//* ** std::cout << e.GetMsg() << std::endl;
std::cout << QString::fromStdWString(e.GetMsg()).toStdString();
}
...
}
Not tested on OS/X and Linux.
Regards
|