<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" 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://www.coin-or.org/Ipopt/documentation/node23.html" class="OWAAutoLink" id="LPlnk247022" previewremoved="true">https://www.coin-or.org/Ipopt/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/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/Ipopt/test'<br>
make[1]: Leaving directory '/home/alex/Ipopt-3.12.8/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="http://www.hsl.rl.ac.uk/ipopt/" class="OWAAutoLink" id="LPlnk371685" previewremoved="true">
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>
</body>
</html>