gbionics / gbionics/osqp-eigen
Cant instantiate the solver; "OsqpEigen::Solver solver"
- Dominant language
- C++
- Stars
- 503
- Forks
- 133
- PR merge metrics
- No merged PRs in 30d
Description
This is how I build the wrapper: (I am using windows btw)
```
git clone https://github.com/robotology/osqp-eigen.git
cd osqp-eigen
mkdir build && cd build
cmake ../
cmake --build . --config Debug
```
This is my CmakeLists.txt file:
```
cmake_minimum_required(VERSION "3.20.0")
project("-----")
find_package (Eigen3 3.3 REQUIRED NO_MODULE)
find_package(osqp REQUIRED)
find_package(OsqpEigen REQUIRED PATHS "C:/Users/Dhruv/Documents/GitHub/osqp-eigen/build")
include_directories("C:/Users/Dhruv/Documents/mujoco200_win64/include")
link_directories("C:/Users/Dhruv/Documents/mujoco200_win64/bin")
add_executable("${PROJECT_NAME}" "main.cpp")
target_link_libraries("${PROJECT_NAME}"
mujoco200
mujoco200nogl
glfw3
glfw3static
Eigen3::Eigen
osqp::osqpstatic
# osqp::osqp
OsqpEigen::OsqpEigen)
```

I am able to compile and run the "osqp" example problems from their website. I am able to include the OsqpEigen.h in my project. When I just instantiate the solver using the wrapper, I am able to build and run the .exe but no output that I was expecting is generated. Just builds and runs with zero errors and nothing happens.
```
#include
#include
#include "osqp.h"
#include "OsqpEigen/OsqpEigen.h"
int main(void){
std::cout << "Hello1" << std::endl;
// instantiate the solver
OsqpEigen::Solver solver;
std::cout << "Hello2" << std::endl;
return 1;
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the CMakeLists.txt and main.cpp shown in the report, then reproduce the Windows build using the listed git, cmake, and build commands. Compare the program's output around the OsqpEigen::Solver solver instantiation with the expected Hello1 and Hello2 markers; done means the minimal example produces the intended output or the issue is narrowed to a documented build or runtime cause.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100