osqp-eigen icon indicating copy to clipboard operation
osqp-eigen copied to clipboard

when operator slover class, an error occured, it shows that there is a undefined reference

Open lovebugayy opened this issue 4 years ago • 3 comments

CMakeFiles/main.dir/main.cpp.o:in the function‘testQP()’: main.cpp:(.text+0x5b5):for‘OsqpEigen::Solver::Solver()’an undefined reference CMakeFiles/main.dir/main.cpp.o:in the function‘std::default_deleteOsqpEigen::Settings::operator()(OsqpEigen::Settings*) const’: main.cpp:(.text.ZNKSt14default_deleteIN9OsqpEigen8SettingsEEclEPS1[ZNKSt14default_deleteIN9OsqpEigen8SettingsEEclEPS1]+0x1e):‘OsqpEigen::Settings::~Settings()’an undefined reference CMakeFiles/main.dir/main.cpp.o:in the function‘std::default_deleteOsqpEigen::Data::operator()(OsqpEigen::Data*) const’: main.cpp:(.text.ZNKSt14default_deleteIN9OsqpEigen4DataEEclEPS1[ZNKSt14default_deleteIN9OsqpEigen4DataEEclEPS1]+0x1e):‘OsqpEigen::Data::~Data()’an undefined reference collect2: error: ld returned 1 exit status src/CMakeFiles/main.dir/build.make:120: recipe for target '../bin/main' failed make[2]: *** [../bin/main] Error 1 CMakeFiles/Makefile2:85: recipe for target 'src/CMakeFiles/main.dir/all' failed make[1]: *** [src/CMakeFiles/main.dir/all] Error 2 Makefile:83: recipe for target 'all' failed make: *** [all] Error 2

lovebugayy avatar Jan 11 '21 12:01 lovebugayy

Hi @lovebugayy, could you provide us with more information, like the OS in which you are running, the version you are using, or the application you are running?

S-Dafarra avatar Jan 11 '21 13:01 S-Dafarra

Hi @lovebugayy I also suggest you use the following markdown block when you copy the code

``` code you want to show ```

and it will display as

code you want to show 

CMakeFiles/main.dir/main.cpp.o:in the function‘testQP()’:
main.cpp:(.text+0x5b5):for‘OsqpEigen::Solver::Solver()’an undefined reference
CMakeFiles/main.dir/main.cpp.o:in the function‘std::default_delete<OsqpEigen::Settings>::operator()(OsqpEigen::Settings*) const’:
main.cpp:(.text._ZNKSt14default_deleteIN9OsqpEigen8SettingsEEclEPS1_[_ZNKSt14default_deleteIN9OsqpEigen8SettingsEEclEPS1_]+0x1e):‘OsqpEigen::Settings::~Settings()’an undefined reference
CMakeFiles/main.dir/main.cpp.o:in the function‘std::default_delete<OsqpEigen::Data>::operator()(OsqpEigen::Data*) const’:
main.cpp:(.text._ZNKSt14default_deleteIN9OsqpEigen4DataEEclEPS1_[_ZNKSt14default_deleteIN9OsqpEigen4DataEEclEPS1_]+0x1e):‘OsqpEigen::Data::~Data()’an undefined reference
collect2: error: ld returned 1 exit status
src/CMakeFiles/main.dir/build.make:120: recipe for target '../bin/main' failed
make[2]: *** [../bin/main] Error 1
CMakeFiles/Makefile2:85: recipe for target 'src/CMakeFiles/main.dir/all' failed
make[1]: *** [src/CMakeFiles/main.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

GiulioRomualdi avatar Jan 12 '21 09:01 GiulioRomualdi

Hi, thanks for your advise. In fact, it's a very simple code. When i use the class OsqpEigen, errors occur, it shows an undefined reference. but i don't know why and where should be changed.

OsqpEigen::Solver solver;

lovebugayy avatar Jan 13 '21 02:01 lovebugayy