Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An exception is triggered when the program get_started.cpp runs here, see what's going on? #216

Open
Wang-Peng-debug opened this issue Sep 2, 2024 · 3 comments

Comments

@Wang-Peng-debug
Copy link

image
Look! This is where the exception comes up, and the detailed is shown as follows:
image
Take a look where the red arrow points out, which said the exception was caused by ipopt-3.dll, but I am confused about that and I don't think so cause the example program included by IPOPT(no CppAD involving) worked very well and no any errors come up. I think perhaps this is caused by lacking of dll file of CppAD, but I am still finding the way of how to build it.

@bradbell
Copy link
Contributor

bradbell commented Sep 9, 2024

I now have access to my windows testing machine and tried the following in a visual studio 2022 command prompt:

git clone https://github.com/coin-or/CppAD.git cppad.git
cd cppad.git
mkdir build
cmake ^
   -G "NMake Makefiles"^
   -D cppad_cxx_flags="/MP /EHs /EHc /std:c++17 /Zc:__cplusplus"^
   -D cppad_static_lib=FALSE^
   ..
nmake check

and I got the following error:

... snip ...
C:\Users\bradl\repo\cppad.git\include\cppad/local/optimize/optimize_run.hpp(332): error C2668: 'CppAD::isnan': ambiguous call to overloaded function 
... snip ...

It seems to me that (since the code is inside the CppAD name space) the CppAD isnan (instead of the std::isnan) should have been chosen.

The following seems to fix this problem: In the file

\cppad.git\include\cppad/local/optimize/optimize_run.hpp(

Changing

isnan( play->GetPar(0) )

to

CppAD::isnan( play->GetPar(0) )

There are other place that this problem occurs. I am going to create a new commit on the master branch that fixes all of them.

@bradbell
Copy link
Contributor

bradbell commented Sep 9, 2024

@Wang-Peng-debug see the heading 09-09 on the page
https://cppad.readthedocs.io/latest/2024.html#mm-dd-09-09
The Visual Studio instructions should work for you (using the most recent master branch).
Please try it and report back.

@Wang-Peng-debug
Copy link
Author

@Wang-Peng-debug see the heading 09-09 on the page https://cppad.readthedocs.io/latest/2024.html#mm-dd-09-09 The Visual Studio instructions should work for you (using the most recent master branch). Please try it and report back.

That's cool!!! I will give it a try, but now I'm in the middle of my work, maybe I'll do it this weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants