3
此錯誤:「1> CL:命令行錯誤〜D8021:無效數值參數 '/ WNO棄用'」 ERRO
"1>cl : Command line error D8021: invalid numeric argument '/Wno-deprecated'"
同時通過MSVC編譯器構建VTK + Qt工程發生。我認爲標誌設置存在一些問題。以下是我的CMakeList.txt
cmake_minimum_required(VERSION 2.8)
PROJECT(QtImageViewer)
IF(NOT VTK_BINARY_DIR)
FIND_PACKAGE(VTK)
INCLUDE(${VTK_USE_FILE})
ENDIF(NOT VTK_BINARY_DIR)
SET(QT_QMAKE_EXECUTABLE ${VTK_QT_QMAKE_EXECUTABLE} CACHE FILEPATH "")
SET(QT_MOC_EXECUTABLE ${VTK_QT_MOC_EXECUTABLE} CACHE FILEPATH "")
SET(QT_UIC_EXECUTABLE ${VTK_QT_UIC_EXECUTABLE} CACHE FILEPATH "")
FIND_PACKAGE(Qt4 REQUIRED)
INCLUDE(${QT_USE_FILE})
SET (SRCS main.cxx)
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR})
ADD_EXECUTABLE(qtimageviewer MACOSX_BUNDLE ${SRCS})
TARGET_LINK_LIBRARIES(qtimageviewer
QVTK
${QT_LIBRARIES}
vtkRendering
vtkGraphics
vtkIO
vtkCommon
)
請解釋一下如何解決這個錯誤?
問:是否按照安裝說明配置QVTK以在Visual Studio下編譯?問:你使用的是哪個版本的Visual Studio?還有:[CMake無效的數值參數](http://stackoverflow.com/questions/2274006/cmake-invalid-numeric-argument-wextra) – paulsm4
我編譯VTK作爲此鏈接的指令http://www.vtk.org/ Wiki/VTK/Building/VisualStudio和我正在使用visual studio 2008編譯器 –