<html><head></head><body><div style="color:#000; background-color:#fff; font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1491203595420_4195"><span>Hi,</span></div><div id="yui_3_16_0_ym19_1_1491203595420_4194"><span><br></span></div><div id="yui_3_16_0_ym19_1_1491203595420_4197" dir="ltr"><span id="yui_3_16_0_ym19_1_1491203595420_4207">When using vc++ we should include gurobi_C++.h (not </span>gurobi_C.h). and the setting parameters proposed by Stefan works.</div><div id="yui_3_16_0_ym19_1_1491203595420_4197" dir="ltr"><br></div><div id="yui_3_16_0_ym19_1_1491203595420_4197" dir="ltr">Yacine, </div><div class="qtdSeparateBR" id="yui_3_16_0_ym19_1_1491203595420_4137"><br><br></div><div class="yahoo_quoted" id="yui_3_16_0_ym19_1_1491203595420_4206" style="display: block;">  <div style="font-family: Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1491203595420_4205"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;" id="yui_3_16_0_ym19_1_1491203595420_4204"> <div dir="ltr" id="yui_3_16_0_ym19_1_1491203595420_4203"> <font size="2" face="Arial" id="yui_3_16_0_ym19_1_1491203595420_4202"> <hr size="1" id="yui_3_16_0_ym19_1_1491203595420_4201"> <b><span style="font-weight:bold;">De :</span></b> Yacine Gaoua <y.gaoua@yahoo.com><br> <b><span style="font-weight: bold;">À :</span></b> "osi@list.coin-or.org" <osi@list.coin-or.org> <br> <b><span style="font-weight: bold;">Envoyé le :</span></b> Vendredi 31 mars 2017 16h24<br> <b><span style="font-weight: bold;">Objet :</span></b> Re: Gurobi setting parameters<br> </font> </div> <div class="y_msg_container" id="yui_3_16_0_ym19_1_1491203595420_4283"><br><div id="yiv2045274079"><div id="yui_3_16_0_ym19_1_1491203595420_4282"><div style="color:#000;background-color:#fff;font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;" id="yui_3_16_0_ym19_1_1491203595420_4281"><div id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_57861">Hi,</div><div id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_57860"><br clear="none"></div><div id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_57830">When i added Gurobi setting parameters, i have follwing erros while i added gurobi70.lib. And when i comment setting parameters, gurobi run normaly.</div><div id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_57859"><br clear="none"></div><div id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_57776">error LNK2001: symbole externe non résolu "struct _GRBenv * __stdcall GRBgetenv(struct _GRBmodel *)" (?GRBgetenv@@YGPAU_GRBenv@@PAU_GRBmodel@@@Z)</div><div dir="ltr" id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_57777"><br clear="none"></div><div dir="ltr" id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_57777">error LNK2001: symbole externe non résolu "int __stdcall GRBsetdblparam(struct _GRBenv *,char const *,double)" (?GRBsetdblparam@@YGHPAU_GRBenv@@PBDN@Z)</div><div id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_57969"><span><br clear="none"></span></div><div class="yiv2045274079qtdSeparateBR" id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_57754">Yacine,<br clear="none"><br clear="none"></div><div class="yiv2045274079yahoo_quoted" id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_57857" style="display:block;">  <div id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_57856" style="font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_57855" style="font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px;"> <div dir="ltr" id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_57858"> <font id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_58042" size="2" face="Arial"> </font><hr id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_58138" size="1"> <b><span style="font-weight:bold;">De :</span></b> Stefan Vigerske <stefan@math.hu-berlin.de><br clear="none"> <b><span style="font-weight:bold;">À :</span></b> Yacine Gaoua <y.gaoua@yahoo.com>; "osi@list.coin-or.org" <osi@list.coin-or.org> <br clear="none"> <b><span style="font-weight:bold;">Envoyé le :</span></b> Vendredi 31 mars 2017 13h55<br clear="none"> <b><span style="font-weight:bold;">Objet :</span></b> Re: Gurobi setting parameters<br clear="none">  </div> <div class="yiv2045274079yqt5923834946" id="yiv2045274079yqt01432"><div class="yiv2045274079y_msg_container" id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_57854"><br clear="none"><div dir="ltr" id="yiv2045274079yui_3_16_0_ym19_1_1490944904702_57853">Hi,<br clear="none"><br clear="none">I use<br clear="none"><br clear="none">GRBenv* grbenv = <br clear="none">GRBgetenv(osigrb->getLpPtr(OsiGrbSolverInterface::KEEPCACHED_ALL));<br clear="none">GRBsetdblparam(grbenv, GRB_DBL_PAR_MIPGAP, 0.1);<br clear="none"><br clear="none">Stefan<br clear="none"><div class="yiv2045274079yqt9735877140" id="yiv2045274079yqtfd40973"><br clear="none">On 03/31/2017 11:45 AM, Yacine Gaoua wrote:<br clear="none">> Thank you Stefan.<br clear="none">> its working very well.<br clear="none">> another question about setting Gurobi parameters. i using  GRBsetdblparam(si->getEnvironmentPtr(), GRB_DBL_ATTR_MIPGAP, this->optimizationGap); but it dosent work, may be its not the good way t define it.<br clear="none">> Thank you in advanceYacine,<br clear="none">><br clear="none">><br clear="none">>       De : Stefan Vigerske <<a rel="nofollow" shape="rect" ymailto="mailto:stefan@math.hu-berlin.de" target="_blank" href="mailto:stefan@math.hu-berlin.de">stefan@math.hu-berlin.de</a>><br clear="none">>  À : Yacine Gaoua <<a rel="nofollow" shape="rect" ymailto="mailto:y.gaoua@yahoo.com" target="_blank" href="mailto:y.gaoua@yahoo.com">y.gaoua@yahoo.com</a>>; "<a rel="nofollow" shape="rect" ymailto="mailto:osi@list.coin-or.org" target="_blank" href="mailto:osi@list.coin-or.org">osi@list.coin-or.org</a>" <<a rel="nofollow" shape="rect" ymailto="mailto:osi@list.coin-or.org" target="_blank" href="mailto:osi@list.coin-or.org">osi@list.coin-or.org</a>><br clear="none">>  Envoyé le : Vendredi 31 mars 2017 11h04<br clear="none">>  Objet : Re: [Osi] OsiGrbSolverInterface Bug<br clear="none">><br clear="none">> Hi.<br clear="none">><br clear="none">> handling the exception may give some insight.<br clear="none">> try<br clear="none">> {<br clear="none">>   OsiSolverInterface *si= new OsiGrbSolverInterface();<br clear="none">> }<br clear="none">> catch( CoinError& error )<br clear="none">> {<br clear="none">>   std::cout << error.message();<br clear="none">> }<br clear="none">><br clear="none">> Could be a missing Gurobi license.<br clear="none">><br clear="none">> Stefan<br clear="none">><br clear="none">> On 03/31/2017 08:42 AM, Yacine Gaoua wrote:<br clear="none">>> Hi,<br clear="none">>> I am using Gurobi Osi interface to solve my problem on vc++ 2010. But when i call solving method, Gurobi stop running whith an error message => (Unhandled exception to 0x751fc54f in smart_grid_CoinOR.exe: Microsoft C ++ Exception: CoinError to memory location 0x0045f010 ..).<br clear="none">>> For th rest of Solvers (CPLEX, XPRESS, MOSEK) it running well.<br clear="none">>> int main(){<br clear="none">>>   //OsiSolverInterface *si= new OsiCpxSolverInterface();  //OsiSolverInterface *si= new OsiXprSolverInterface();  //OsiSolverInterface *si= new OsiMskSolverInterface();<br clear="none">>>   OsiSolverInterface *si= new OsiGrbSolverInterface(); //Error<br clear="none">>>   si->readLp("test1.lp");  si->branchAndBound();<br clear="none">>> return 0;}<br clear="none">>> Thanks for help<br clear="none">>><br clear="none">>><br clear="none">>><br clear="none">>> _______________________________________________<br clear="none">>> Osi mailing list<br clear="none">>> <a rel="nofollow" shape="rect" ymailto="mailto:Osi@list.coin-or.org" target="_blank" href="mailto:Osi@list.coin-or.org">Osi@list.coin-or.org</a><br clear="none">>> <a rel="nofollow" shape="rect" target="_blank" href="https://list.coin-or.org/mailman/listinfo/osi">https://list.coin-or.org/mailman/listinfo/osi</a><br clear="none">>><br clear="none">><br clear="none">><br clear="none"><br clear="none"><br clear="none">-- <br clear="none"><a rel="nofollow" shape="rect" target="_blank" href="http://www.gams.com/~stefan">http://www.gams.com/~stefan</a><br clear="none"></div></div><br clear="none"><br clear="none"></div></div> </div> </div>  </div></div></div></div><br><br></div> </div> </div>  </div></div></body></html>