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

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

Open
lovebugayy opened this issue Jan 11, 2021 · 3 comments

Comments

@lovebugayy
Copy link

lovebugayy commented Jan 11, 2021

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

@S-Dafarra
Copy link
Collaborator

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?

@GiulioRomualdi
Copy link
Member

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

@lovebugayy
Copy link
Author

lovebugayy commented Jan 13, 2021

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;

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

3 participants