robotology / osqp-eigen

Simple Eigen-C++ wrapper for OSQP library
https://robotology.github.io/osqp-eigen/
BSD 3-Clause "New" or "Revised" License
396 stars 118 forks source link

Can I use osqp-eigen on Windows10 with QT? #77

Closed Tengyun-Mo closed 3 years ago

Tengyun-Mo commented 3 years ago

When I make the project,I got this : make: No targets specified and no makefile found. but cmake is ok.

The C compiler identification is MSVC 18.0.21005.1
The CXX compiler identification is MSVC 18.0.21005.1
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Check for working C compiler: D:/360Downloads/Software/VS2013/VC/bin/x86_amd64/cl.exe - skipped
Detecting C compile features
Detecting C compile features - done
Detecting CXX compiler ABI info
Detecting CXX compiler ABI info - done
Check for working CXX compiler: D:/360Downloads/Software/VS2013/VC/bin/x86_amd64/cl.exe - skipped
Detecting CXX compile features
Detecting CXX compile features - done
Configuring done
Generating done
traversaro commented 3 years ago

Hi @Tengyun-Mo ! From the error messages it seems that you are on Windows, and on Windows if you do not specify the cmake generator the default generator is the Visual Studio one. To build osqp-eigen in that case, then you need to open the generated project with Visual Studio, or just execute cmake --build . --config Release, instead of executing make. For more on using CMake with Visual Studio, please read https://cgold.readthedocs.io/en/latest/first-step.html and in particular section 2.6.1 and 2.6.3 .

However, from your log it seems that you are using Visual Studio 2013, and I am not sure if osqp-eigen compiles fine on Visual Studio 2013. We are actively testing and using osqp-eigen with Visual Studio 2019, so it could make sense to try to compile it with Visual Studio 2019.

S-Dafarra commented 3 years ago

Also, if you are using "Qt Creator" as IDE, make sure to select the target ALL_BUILD instead of all, see https://bugreports.qt.io/browse/QTCREATORBUG-24861?page=com.googlecode.jira-suite-utilities%3Atransitions-summary-tabpanel

Tengyun-Mo commented 3 years ago

Thanks for your response.I have fixed this problem by steps as follows:

  1. git clone https://github.com/robotology/osqp-eigen.git
  2. cd osqp-eigen
  3. mkdir build && cd build
  4. cmake -G "MinGW Makefiles" ..
  5. make --build .
  6. cmake --build . --target install
dhruvthanki commented 3 years ago

I tried building the library on Windows. Used 'cmake --build . --config Release' instead of make. Got the following error. How do I solve this. osqp-eigen

S-Dafarra commented 3 years ago

Hi @dhruvthanki there seems to be a linking problem with osqp. Did osqp compile correctly? What is the cmake output?

dhruvthanki commented 3 years ago

I am able to include osqp.h in my project. but it path is: "C:\Program Files (x86)\osqp", not x65. Picture below is osqp-eigen "cmake ../" result: osqp-eigen-2

S-Dafarra commented 3 years ago

Unfortunately that output does not tell much. My guess is that cmake is able to find ospq.h, but not the library. Did you modify some paths manually?

Also, I would ask tou to open a new issue since this does not seem to be related to the OP, and this is already closed.

traversaro commented 3 years ago

In the new issue that @S-Dafarra suggested to open, please provide the exact commands that you used to install osqp, thanks.