<div dir="ltr"><div><div>> Do I need AMPL for the example?<br><br></div>No. <br><br>> Am I linking the files correctly?<br><br></div>No. I think the best way to do it is using the Makefile in the directory ${your_ipopt_build_path}/Ipopt/examples/hs071_cpp/. <br><br>You just have to do simple changes (e.g. the EXE and OBJS definitions). You can take advantage this Makefile to build all your applications using C++ interface.<br><br>> Is there a 'bare bones' C++ example that doesn't use smart pointers or the IpoptApplicationFactory?<div><br></div><div>I am not sure, but I think IpoptApplicationFactory is really necessary in the C++ interface. I believe it is possible adopt no smart pointers.<br><br><br></div><div>Regards<br><br></div><div>Wendel<br></div><div><br><br><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-08-23 23:26 GMT-03:00 Alexander Martinez-Marchese <span dir="ltr"><<a href="mailto:alex.martinezmarchese@outlook.com" target="_blank">alex.martinezmarchese@outlook.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div id="m_-2558496296078119075divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>Hi,</p>
<p><br>
</p>
<p> I'm trying to run the C++ example described here:</p>
<p><br>
</p>
<p><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__www.coin-2Dor.org_Ipopt_documentation_node23.html&d=DwMFAw&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=AEWIZiNSSlppb_jyQKA8GtHkg2N4WiI7Ya5btonYBgA&m=ZQeH40ZHG9NwfMsxzGOm9crFiwZNdbp1D-HraEXQENU&s=VQRxhgqUJI4BKSd1gNC312YC5Bio3XpnudRchOg1kaY&e=" class="m_-2558496296078119075OWAAutoLink" id="m_-2558496296078119075LPlnk247022" target="_blank">https://www.coin-or.org/Ipopt/<wbr>documentation/node23.html</a></p>
<p><br>
</p>
<p><br>
</p>
<p>So I copied the files myexample.cpp, hs071_nlp.cpp and hs071_nlp.cpp and I run the following in the terminal (within Ubuntu linux):</p>
<p><br>
</p>
<p><span>c++ -std=c++11 myexample.cpp hs071_nlp.cpp -o myexample -I /home/alex/Ipopt-3.12.8/<wbr>include/coin</span></p>
<p><span><br>
</span></p>
<p><span>And I get the following error:</span></p>
<p><br>
<span></span></p>
<p></p>
<div>/tmp/ccIUQtXB.o: In function `main':<br>
myexample.cpp:(.text+0x52): undefined reference to `IpoptApplicationFactory'<br>
collect2: error: ld returned 1 exit status</div>
<p></p>
<p><br>
</p>
<p><br>
</p>
<p>I tested my IPOPT installation using 'make test' and I get this:</p>
<p></p>
<div><br>
</div>
<div>Running unitTests...<br>
Testing AMPL Solver Executable...<br>
no AMPL solver executable found, skipping test...<br>
Testing C++ Example...<br>
Test passed!<br>
Testing C Example...<br>
Test passed!<br>
Testing Fortran Example...<br>
Test passed!<br>
make[2]: Leaving directory '/home/alex/Ipopt-3.12.8/<wbr>Ipopt/test'<br>
make[1]: Leaving directory '/home/alex/Ipopt-3.12.8/<wbr>Ipopt'<br>
<br>
</div>
Do I need AMPL for the example? Am I linking the files correctly? Is there a 'bare bones' C++ example that doesn't use smart pointers or the IpoptApplicationFactory?
<p></p>
<p><br>
</p>
<p>I am able to use IPOPT from pyipopt to solve l-bfgs-b problems. The IPOPT installation was installed with the HSL files:
<a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.hsl.rl.ac.uk_ipopt_&d=DwMFAw&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=AEWIZiNSSlppb_jyQKA8GtHkg2N4WiI7Ya5btonYBgA&m=ZQeH40ZHG9NwfMsxzGOm9crFiwZNdbp1D-HraEXQENU&s=qADmP8Rclh0Q6kTBikgNgeak4Pg5HZyeAGKJt2-o_M0&e=" class="m_-2558496296078119075OWAAutoLink" id="m_-2558496296078119075LPlnk371685" target="_blank">
http://www.hsl.rl.ac.uk/ipopt/</a></p>
<p><br>
</p>
<p><br>
</p>
<p>Thank you,</p>
<p>Alex</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
</div>
</div>
<br>______________________________<wbr>_________________<br>
Ipopt mailing list<br>
<a href="mailto:Ipopt@list.coin-or.org">Ipopt@list.coin-or.org</a><br>
<a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__list.coin-2Dor.org_mailman_listinfo_ipopt&d=DwICAg&c=Ngd-ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLxWPA_2Wlc4&r=AEWIZiNSSlppb_jyQKA8GtHkg2N4WiI7Ya5btonYBgA&m=ZQeH40ZHG9NwfMsxzGOm9crFiwZNdbp1D-HraEXQENU&s=zTRKLH_Pb24IsUPAeBx1kZh0vYqZA9sfNBMwStyYqlA&e=" rel="noreferrer" target="_blank">https://urldefense.proofpoint.<wbr>com/v2/url?u=https-3A__list.<wbr>coin-2Dor.org_mailman_<wbr>listinfo_ipopt&d=DwICAg&c=Ngd-<wbr>ta5yRYsqeUsEDgxhcqsYYY1Xs5ogLx<wbr>WPA_2Wlc4&r=AEWIZiNSSlppb_<wbr>jyQKA8GtHkg2N4WiI7Ya5btonYBgA&<wbr>m=<wbr>ZQeH40ZHG9NwfMsxzGOm9crFiwZNdb<wbr>p1D-HraEXQENU&s=zTRKLH_<wbr>Pb24IsUPAeBx1kZh0vYqZA9sfNBMwS<wbr>tyYqlA&e=</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Wendel</div>
</div>