[Ipopt] Help with IPOPT linking problems on Windows MSVC/

Jesse Perla jesseperla at gmail.com
Mon Aug 25 00:27:27 EDT 2008


> >If possible, then you should have all libraries build with the same flag,
> that is all debug, or all multithreaded-dll, or whatever...
> >If you build Ipopt with Visual Studio and wanna use MUMPS, then I don't
> know how VS will know how to compile this Fortran90 package.
> >When you follow the MinGW instruction, you can overwrite compiler flags
> (CFLAGS, CXXFLAGS, FFLAGS) to make sure that they all use the same
> -MT/-MTd/... flags. It should be correct already for the >default build
> (=-MT), but for the debug build I'm not sure.
> Stefan


Hi guys,  See the following linking problems below (going through the
standard steps this time and not doing anything fancy).  Should I give MinGW
a shot instead of using the visual studio builds?

So, to recap:  I had the test binaries working with the sample application
if I:
 * Linked to libipopt.lib.  That is it.
 * Set to /MT and didn't do a debug build.
 * Compiles and runs no problem, but can't find any permutation of linking
to do a debug build of my own code.  So need to go through the build
process.

In order to get debug binaries, I got the Ipopt 3.4.2 source:
 * I followed the exact instructions under the visual studio 8 directory
(though I do have visual studio 2008... but I don't think that is the
problem).
 * For the linear solver, I followed the instructions that say to use HSL
MA27 and MC19 because there aren't any mumps instructions/files.  No
ampl/ASL for me.
 * I got the Netlib LAPACK and BLAS, f2c, etc.
 * I build the libraries, no problem from instructions... (I can even built
a debug and a multithreaded dll /MD release, but I didn't test these).  Note
that I am staying in MSVC, not using Intel C++

But....
 * When I go back to the cpp_example project that worked fine with the
distriubuted binaries and unmodified, link it to the new release /MT
libipopt.lib which I thought should be identical (expect perhaps HSL instead
of mumps?), I run into linking problems.
* First, I assume that I need more than libipopt.lib now and added the
following libraries to the linker: "libipopt.lib libcoinHSL.lib vcf2c.lib
libcoinlapack.lib libcoinblas.lib"  which were the only libraries I could
find that were generated in the build
  *[[[ As an important sidenote, I am going to use this when I already have
MKL linked in for BLAS/LAPACK support, so I tried to link with:
"libipopt.lib mkl_intel_c.lib mkl_core.lib mkl_sequential.lib libmmd.lib
libCOINHSL.lib vcf2c.lib".  With these I had the exact same unresolved
externals as with the libcoinlapack.lib, etc. leading me to believe that we
will be able to link in MKL.  This is important to ensure no double symbols
when I use MKL for other stuff in the same project.  Note that this may be a
good reason to build libipopt.lib in pieces instead of the library monolith
that was distributed in the test binaries ]]]

Here are the unresolved symbols:

1>libipopt.lib(IpAlgBuilder.obj) : error LNK2001: unresolved external symbol
"public: __thiscall
Ipopt::RestoPenaltyConvergenceCheck::RestoPenaltyConvergenceCheck(void)"
(??0RestoPenaltyConvergenceCheck at Ipopt@@QAE at XZ)
1>libipopt.lib(IpAlgorithmRegOp.obj) : error LNK2001: unresolved external
symbol "public: static void __cdecl
Ipopt::RestoPenaltyConvergenceCheck::RegisterOptions(class
Ipopt::SmartPtr<class Ipopt::RegisteredOptions>)"
(?RegisterOptions at RestoPenaltyConvergenceCheck@Ipopt@
@SAXV?$SmartPtr at VRegisteredOptions@Ipopt@@@2@@Z)
1>libipopt.lib(IpAlgorithmRegOp.obj) : error LNK2001: unresolved external
symbol "public: static void __cdecl
Ipopt::RestoConvergenceCheck::RegisterOptions(class Ipopt::SmartPtr<class
Ipopt::RegisteredOptions>)" (?RegisterOptions at RestoConvergenceCheck@Ipopt@
@SAXV?$SmartPtr at VRegisteredOptions@Ipopt@@@2@@Z)
1>libipopt.lib(IpRestoFilterConvCheck.obj) : error LNK2001: unresolved
external symbol "public: __thiscall
Ipopt::RestoConvergenceCheck::RestoConvergenceCheck(void)"
(??0RestoConvergenceCheck at Ipopt@@QAE at XZ)
1>libipopt.lib(IpRestoFilterConvCheck.obj) : error LNK2001: unresolved
external symbol "public: virtual enum
Ipopt::ConvergenceCheck::ConvergenceStatus __thiscall
Ipopt::RestoConvergenceCheck::CheckConvergence(bool)"
(?CheckConvergence at RestoConvergenceCheck@Ipopt@
@UAE?AW4ConvergenceStatus at ConvergenceCheck@2 at _N@Z)
1>libipopt.lib(IpRestoFilterConvCheck.obj) : error LNK2001: unresolved
external symbol "public: virtual __thiscall
Ipopt::RestoConvergenceCheck::~RestoConvergenceCheck(void)"
(??1RestoConvergenceCheck at Ipopt@@UAE at XZ)
1>libipopt.lib(IpRestoFilterConvCheck.obj) : error LNK2001: unresolved
external symbol "public: virtual bool __thiscall
Ipopt::RestoConvergenceCheck::InitializeImpl(class Ipopt::OptionsList const
&,class std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)" (?InitializeImpl at RestoConvergenceCheck
@Ipopt@@UAE_NABVOptionsList at 2@ABV?$basic_string at DU?$char_traits at D@std@
@V?$allocator at D@2@@std@@@Z)
1>C:\working\libraries\etk\examples\test_etk_coin\Release\test_etk_coin.exe
: fatal error LNK1120: 7 unresolved externals
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/ipopt/attachments/20080825/39c194ac/attachment.html 


More information about the Ipopt mailing list