2015-01-04 176 views
0

我试图在Visual Studio 2012中使用nmake。叫我这个错误U1001:语法错误:宏中的非法字符'{'停止。在Visual Studio 2012中使用nmake qpOASES

我的命令是“nmake make.mk”。我的错误在哪里?

感谢您的回复

图书馆qpOASES 3.1 文件的内容 “make.mk” 是:

## This file is part of qpOASES. 
## 
## qpOASES -- An Implementation of the Online Active Set Strategy. 
## Copyright (C) 2007-2014 by Hans Joachim Ferreau, Andreas Potschka, 
## Christian Kirches et al. All rights reserved. 
## 
## qpOASES is free software; you can redistribute it and/or 
## modify it under the terms of the GNU Lesser General Public 
## License as published by the Free Software Foundation; either 
## version 2.1 of the License, or (at your option) any later version. 
## 
## qpOASES is distributed in the hope that it will be useful, 
## but WITHOUT ANY WARRANTY; without even the implied warranty of 
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
## See the GNU Lesser General Public License for more details. 
## 
## You should have received a copy of the GNU Lesser General Public 
## License along with qpOASES; if not, write to the Free Software 
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 
## 



## 
## Filename: make.mk 
## Author: Hans Joachim Ferreau, Andreas Potschka, Christian Kirches 
## Version: 3.0 
## Date:  2007-2014 
## 


TOP = $(realpath $(dir $(lastword $(MAKEFILE_LIST)))) 

#include ${TOP}/make_linux.mk 
#include ${TOP}/make_cygwin.mk 
include ${TOP}/make_windows.mk 
#include ${TOP}/make_osx.mk 

make_windows:

## 
## This file is part of qpOASES. 
## 
## qpOASES -- An Implementation of the Online Active Set Strategy. 
## Copyright (C) 2007-2014 by Hans Joachim Ferreau, Andreas Potschka, 
## Christian Kirches et al. All rights reserved. 
## 
## qpOASES is free software; you can redistribute it and/or 
## modify it under the terms of the GNU Lesser General Public 
## License as published by the Free Software Foundation; either 
## version 2.1 of the License, or (at your option) any later version. 
## 
## qpOASES is distributed in the hope that it will be useful, 
## but WITHOUT ANY WARRANTY; without even the implied warranty of 
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
## See the GNU Lesser General Public License for more details. 
## 
## You should have received a copy of the GNU Lesser General Public 
## License along with qpOASES; if not, write to the Free Software 
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 
## 



## 
## Filename: make_windows.mk 
## Author: Hans Joachim Ferreau, Andreas Potschka, Christian Kirches 
## Version: 3.0 
## Date:  2007-2014 
## 


## 
## definitions for compiling with Visual Studio under Windows 
## 


################################################################################ 
# user configuration 

# include directories, relative 
IDIR = ${TOP}/include 
SRCDIR = ${TOP}/src 
BINDIR = ${TOP}/bin 

# Matlab include directory (ADAPT TO YOUR LOCAL SETTINGS!) 
#MATLAB_IDIR = ${HOME}/Programs/matlab/extern/include/ 
MATLAB_IDIR = /usr/local/matlab/extern/include/ 
MATLAB_LIBDIR = /usr/local/matlab/bin/glnxa64/ 


# system or replacement BLAS/LAPACK 
REPLACE_LINALG = 1 

ifeq ($(REPLACE_LINALG), 1) 
    LIB_BLAS = ${SRCDIR}/BLASReplacement.o 
    LIB_LAPACK = ${SRCDIR}/LAPACKReplacement.o 
else 
    LIB_BLAS = /usr/lib/libblas.so 
    LIB_LAPACK = /usr/lib/liblapack.so 
endif 


################################################################################ 
# do not touch this 

CPP = cl 
AR = ar 
RM = rm 
F77 = gfortran 
ECHO = echo 
CD = cd 
CP = copy 

# file extensions 
OBJEXT = obj 
LIBEXT = lib 
DLLEXT = so 
EXE = .exe 
MEXOCTEXT = mex 
DEF_TARGET = 
SHARED = /LD 

# 32 or 64 depending on target platform 
BITS = $(shell getconf LONG_BIT) 

# decide on MEX interface extension 
ifeq ($(BITS), 32) 
    MEXEXT = mexglx 
else 
    MEXEXT = mexa64 
endif 

CPPFLAGS = -nologo -EHsc -DWIN32 -Dsnprintf=_snprintf 
#-g -D__DEBUG__ -D__NO_COPYRIGHT__ -D__SUPPRESSANYOUTPUT__ 

FFLAGS = -Wall -O3 -fPIC -DWIN32 -Wno-uninitialized 
#  -g 

# libraries to link against when building qpOASES .so files 
LINK_LIBRARIES = ${LIB_LAPACK} ${LIB_BLAS} 
LINK_LIBRARIES_AW = ${LIB_LAPACK} ${LIB_BLAS} -lm -lgfortran -lhsl_ma57 -lfakemetis 

# how to link against the qpOASES shared library 
QPOASES_LINK = /I${BINDIR} /WL /link ${BINDIR}/libqpOASES.lib 
QPOASES_AW_LINK = /I${BINDIR} /WL /link ${BINDIR}/libqpOASES_aw.lib 

# link dependencies when creating executables 
LINK_DEPENDS = ${LIB_LAPACK} ${LIB_BLAS} ${BINDIR}/libqpOASES.${LIBEXT} ${BINDIR}/libqpOASES.${DLLEXT} 


## 
## end of file 
## 

回答

0

文件make.mk是Linux 。文件make_windows.mk(就像它在其中的注释中所述)是用于使用Visual Studio的窗口。

你会调用nmake使用正确的makefile用命令:

nmake /f make_windows.mk 

这岂不是在文档中解释一下吗?

0

按照手册中的规定:

  • make_linux.mk,默认选择,在Linux下编译,
  • make_cygwin.mk使用Cygwin的Windows下编译,
  • make_windows.mk编译在Windows下使用Microsoft Visual Studio,
  • make_osx.mk在Mac OS X下编译。