[Ipopt] Access violation using Ipopt Win32 DLL

Spacecookies spacecookies1 at hotmail.com
Fri Dec 24 04:43:08 EST 2010

Thanks Marcel, you nailed it... Microsoft is getting coal this year  :P

Linking against the Ipopt DLL with VS 2008 works perfectly for me (in 
addition to VS 2005 as you mention). So it's just the VS 2010 compiler 
(version 16) that's different. I Googled a bit but couldn't find any 
official mention of this change in the compiler behaviour.

As far as how to maintain the DLLs, I'm not sure if I have any advice for 
you... Maybe just update the readme with a note about this issue and leave 
it at that for now. I wonder how Microsoft itself deals with this issue. I 
suppose they must ship multiple versions of all their DLLs...

Also thanks for the note about the header files and the HAVE_CONFIG_H 
define. Missed that somehow :)

Happy holidays,

-----Original Message----- 
From: Marcel Roelofs
Sent: Thursday, December 23, 2010 2:47 AM
To: ipopt at list.coin-or.org
Subject: Re: [Ipopt] Access violation using Ipopt Win32 DLL

Hi Spacecookies,

I'm the maintainer of these precompiled DLLs, and, yes, we are
successfully using them ourselves :)

I've just added the hs071_cpp example to the v8-ifort solution in the
trunk, compiled it in all configurations and they all ran fine with the
precompiled DLLs.

However, I'm using VS 2005 to compile the v8-ifort project. When I tried
to compile the hs071_cpp example with VS 2010, I got the same crash that
you experienced. My guess is that Microsoft changed the binary layout of
std::string objects again in VS 2010 (like the fact that they were
already different in release and debug code in VS 2005), and, yes, in
the crashing call, a std::string object is passed via the Ipopt options
interface. Isn't life nice? My guess would be that the C interface will
still work fine in VS 2010, btw.

I'm a bit at a loss now how to proceed further. I've no problem with
providing the precompiled DLLs we're using ourselves back to community
as well, but am now wondering how much more effort I should invest in
setting up something (ie. precompiled VS 2010 DLLs) that we're not
actively using ourselves at the moment.

BTW. The missing header files you mentioned are the result of not
defining HAVE_CONFIG_H as described in the README file of the binary
distribution. With HAVE_CONFIG_H defined it is looking for
config_ipopt.h which is included in the binary dist.


Marcel Roelofs
Paragon Decision Technology (www.aimms.com)

> Hi all,
> So I?ve been trying to use the precompiled Ipopt 3.9.1 Win32 DLL
without much success.
> I?ve built a simple test case for it using the hs071_cpp example. I
always get an access
> violation error on line 40 of hs071_main.cpp where
app->Options()->setNumericValue(...) is called.
> The same thing happens in both Debug and Release builds (using the
respective Debug and Release
> versions of the Ipopt DLL).
> I?ve uploaded the Visual Studio 2010 project here if anyone wants to
take a look:
> http://www.mediafire.com/file/3dshj63kftzta83/ipopt_msvc_test.zip
> There?s not much to it. I just got the precompiled Win32 binaries from
> added the 2 missing header files (configall_system.h and
configall_system_msc.h) from the source...
> http://www.coin-or.org/download/source/Ipopt/Ipopt-3.9.1.zip
> added the 3 source files from Ipopt-3.9.1\Ipopt\examples\hs071_cpp to
a blank Visual Studio 2010
> project, and built it (on Windows 7 32-bit). I don?t really see where
I could have gone wrong...
> but I?d sure like to know. Has anyone else successfully used these
> Thanks for any help,
> Spacecookies

CONFIDENTIALITY: This e-mail and any attachments are confidential and may be 
privileged. If you are not a named recipient, please notify the sender 
immediately and do not disclose the contents to another person, use it for 
any purpose or store or copy the information in any medium.

Ipopt mailing list
Ipopt at list.coin-or.org

More information about the Ipopt mailing list