coin-or / qpOASES

Open-source C++ implementation of the recently proposed online active set strategy
GNU Lesser General Public License v2.1
385 stars 129 forks source link

Failed to install qpOASES on Windows using Visual Studio #53

Closed svigerske closed 4 years ago

svigerske commented 4 years ago

Issue created by migration from Trac.

Original creator: wellbeing

Original creation time: 2016-07-22 20:50:19

Assignee: ferreau

Version: 3.2.0

Dear Sir or Madam,

I tried to install/compile qpOASES on Windows 10 using Visual Studio 2013. Specifically, I typed "nmake" in the command line of Developer Command Prompt for VS2013 and then I got the following error:

make.mk(32) : fatal error U1000: syntax error : ')' missing in macro invocation

According to this error, I modified "TOP = $(realpath $(dir $(lastword $(MAKEFILE_LIST))))" in the make.mk file as "TOP = $(realpath) $(dir) $(lastword) $(MAKEFILE_LIST)", then the error disappeared. However, at the same time, I got a new error:

make.mk(32) : fatal error U1000: syntax error : ')' missing in macro invocation

which is caused by "include ${TOP}/make_windows.mk" in the make.mk file. Tentatively, I revised "include ${TOP}/make_windows.mk" as "include make_windows.mk", in this way, I got the following error:

make_windows.mk(41) : fatal error U1001: syntax error : illegal character '{' in macro

Could someone help me to complete the installation? Thanks very much.

svigerske commented 4 years ago

Comment by ferreau created at 2016-08-12 13:17:10

I have little experience in using nmake, but it does not seem to be straightforward to provide cross-platform makefiles that run both under Linux and Windows. I guess this is the reason tools like CMake have been developed.

Though it is possible to install qpOASES using CMake and CMake supports to export Visual Studio projects, this possibility is currently not implemented. We appreciate anybody's help in extending the current CMake setup to generate Visual Studio projects for qpOASES as we cannot take care of this ourselves.

svigerske commented 4 years ago

Comment by ferreau created at 2016-08-12 13:18:07

Resolution: wontFix

svigerske commented 4 years ago

Comment by shaww created at 2017-07-04 07:55:44

Hello I had this same issue trying to install for using Visual Studio. After searching through forums I ended up with the following steps that uses CMake to install qpOASES:

  1. Install CMake for Windows from the website https://cmake.org/download/
  2. Open the developer command prompt for Visual Studio: Start -> All Programs -> Visual Studio 2015 -> Visual Studio Tools
  3. Make sure the path is set for visual studio to recognize cmake, type the following in the command prompt (replace with the appropriate location of your CMake): set PATH="C:\Program Files\CMake\bin\
  4. In the command prompt cd to the qpOASES\ directory where CMakeLists.txt is located
  5. Run the following commands (for the appropriate version of Visual Studio): mkdir build cd build cmake -G "Visual Studio 15 2017" .. cmake --build
  6. Navigate to the build directory, double click on the ALL_BUILD (the VC++ project) and wait for Visual Studio to open
  7. Set the build type to "Release", right click ALL_BUILD and select build
  8. Right click INSTALL and select build

The library files should now be installed in the Program Files directory of your computer. You should be able to add the include and library files in your Visual Studio project and start working with qpOASES.