Replies: 16 comments 13 replies
-
It appears that you are not including the ipopt library on your in the
command that is creating the executable.
It might help to run a simple ipopt example, that does not is CppAD, to
ensure it is properly installed and the linking works.
… I am completely new to cppad and I apologize if this is a stupid question.
I have been trying to install cppad and ipopt for a day now and it's
getting really frustrating as I don't know how to solve this problem. I am
trying to use Cppad in my program but I run into the error:
In function `void CppAD::ipopt::solve<CppAD::vector<double>, (anonymous
namespace)::FG_eval>(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > const&,
CppAD::vector<double> const&,CppAD::vector<double> const&,
CppAD::vector<double> const&, CppAD::vector<double> const&,
CppAD::vector<double> const&, (anonymous namespace)::FG_eval&,
CppAD::ipopt::solve_result<CppAD::vector<double> >&)':
ipopt_test.cpp:(.text+0xe0a): undefined reference to
`Ipopt::IpoptApplication::IpoptApplication(bool, bool)'
collect2: error: ld returned 1 exit status
I can't find many resources online of people having the same problem. To
check if it is my program I tried running the following [example](
https://www.coin-or.org/CppAD/Doc/ipopt_nlp_get_started.cpp.htm) but I get
the same error. Wondering if you guys know about it
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#39
|
Beta Was this translation helpful? Give feedback.
-
Please close this issue if the answer above solved this problem. |
Beta Was this translation helpful? Give feedback.
-
I also have the same question. How do you solve it in the end? Thanks! |
Beta Was this translation helpful? Give feedback.
-
@lxjlu It was my fault, I was using ROS and the cmakelists.txt file was not configured correctly |
Beta Was this translation helpful? Give feedback.
-
I also used it for the first time, and I understand whether it is a problem in the link section. I am directly g++ -o example example.cpp. Is there any problem, thank you. |
Beta Was this translation helpful? Give feedback.
-
I assume you are using Ipopt and have installed it. If on your cmake command line you choose cmake_verbose_makefile eqaul to YES and you also specify ipopt_prefix then during the make check you should see how CppAD links in ipopt. |
Beta Was this translation helpful? Give feedback.
-
Thanks, I will check it carefully. |
Beta Was this translation helpful? Give feedback.
-
It will be easier to see if you only check to ipopt_solve examples; i.e., use |
Beta Was this translation helpful? Give feedback.
-
@Jackhe96 Hi, I'm running into the exact same error. How did you fix your cmakelists.txt? |
Beta Was this translation helpful? Give feedback.
-
@tu-trinh By the exact same error do you mean ?
|
Beta Was this translation helpful? Give feedback.
-
I have the same problem: |
Beta Was this translation helpful? Give feedback.
-
Is the undefined reference during the testing of CppAD ? |
Beta Was this translation helpful? Give feedback.
-
I am still getting the following error I ain't checking out where is the problem cmake_minimum_required (VERSION 3.5) add_definitions(-std=c++11) set(CXX_FLAGS "-Wall") set(sources src/ipopt_test.cpp src/main.cpp) include_directories(src/Eigen-3.3) add_executable(ipopt_tests ${sources}) target_link_libraries(ipopt_tests ipopt python2.7) |
Beta Was this translation helpful? Give feedback.
-
I just fixed a problem that came up when building the ipopt tests and ipopt is the only optional package. (Testing this was motivated by your message above); see 03-04 on Please test the current master and see if it fixes your problem. |
Beta Was this translation helpful? Give feedback.
-
I also encountered the same problem. @hichamhendy could you pls share the simple demo codes with me? |
Beta Was this translation helpful? Give feedback.
-
Try the following on your machine and see if you get an error message ?
I did not get any errors and got the final result:
|
Beta Was this translation helpful? Give feedback.
-
I am completely new to cppad and I apologize if this is a stupid question. I have been trying to install cppad and ipopt for a day now and it's getting really frustrating as I don't know how to solve this problem. I am trying to use Cppad in my program but I run into the error:
In function
void CppAD::ipopt::solve<CppAD::vector<double>, (anonymous namespace)::FG_eval>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, CppAD::vector<double> const&,CppAD::vector<double> const&, CppAD::vector<double> const&, CppAD::vector<double> const&, CppAD::vector<double> const&, (anonymous namespace)::FG_eval&, CppAD::ipopt::solve_result<CppAD::vector<double> >&)': ipopt_test.cpp:(.text+0xe0a): undefined reference to
Ipopt::IpoptApplication::IpoptApplication(bool, bool)'collect2: error: ld returned 1 exit status
I can't find many resources online of people having the same problem. To check if it is my program I tried running the following example but I get the same error. Wondering if you guys know about it
Beta Was this translation helpful? Give feedback.
All reactions