使用MinGW为Qt构建VTK时出错

时间:2015-12-28 12:58:40

标签: cmake vtk mingw32

我是Qt的新手,我第一次尝试VTK。 我有以下

O.S:Windows 7终极版 Qt IDE:版本5.3.2
VTK版本:6.3.0
编译:MinGW

为配置VTK for Qt,我按照以下步骤操作:
 1.下载VTK版本并将其解压缩到“c:/ vtk / source”
 2.创建了其他目录“c:/ vtk / build”和“c:/ vtk / install”
 3.打开Cmake GUI并将指定的源打开到“c:/ vtk / source”并构建到“c:/ vtk / build”
VTK_QT_VERSION到5
检查VTK_Goup_Qt
对于“CMAKE_INSTALL_PRIFIX” / vtk / install“
BUILD_EXAMPLES已检查
4.我点击“添加条目”并将CMAKE_PREFIX_PATH添加到“C:/Qt/Qt5.3.2/Tools/mingw482_32”。这是VTK here的指示 5.单击配置,配置完成后,我点击了生成 6.在系统路径
上添加“c:/ vtk / build” 6.打开命令提示符并cd到build目录 7.键入“mingw32-make -j8”(我的电脑有4个处理器)

它开始建设然后我很高兴并且希望一切都能顺利进行,所以我耐心等待它完成,同时啜饮一罐汽水,但令我非常失望的是它增加了77%并给了我这个令人心碎的错误! BR />

...
...
[ 77%] Linking CXX shared library ..\..\bin\libvtkRenderingVolume-6.3.dll
[ 77%] Built target vtkRenderingVolume
Makefile:126: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

我很快复制了部分错误,并将其粘贴在google和stackoverflow上,看看是否有人有类似的问题,但这似乎是独一无二的。我使用其他方法进行了搜索,但是在为Qt构建VTK时没有人遇到过这个问题 请问我做错了什么?请原谅我,如果我做错了,我只是一个初学者。谢谢

在没有mingw32-make的情况下键入-j8来构建VTK可以提供有关错误的更多信息。这是它:

C:/Qt/Qt5.3.2/Tools/mingw482_32/i686-w64-mingw32/include/c++/i686-w64-mingw32/bi
ts/c++config.h:186:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^
C:/Qt/Qt5.3.2/Tools/mingw482_32/i686-w64-mingw32/include/c++/i686-w64-mingw32/bi
ts/c++config.h:186:26: note:   'std::size_t'
In file included from C:/MinGW/include/wchar.h:18:0,
                 from C:/Qt/Qt5.3.2/Tools/mingw482_32/i686-w64-mingw32/include/c
++/cwchar:44,
                 from C:/Qt/Qt5.3.2/Tools/mingw482_32/i686-w64-mingw32/include/c
++/bits/postypes.h:40,
                 from C:/Qt/Qt5.3.2/Tools/mingw482_32/i686-w64-mingw32/include/c
++/iosfwd:40,
                 from C:/Qt/Qt5.3.2/Tools/mingw482_32/i686-w64-mingw32/include/c
++/ios:38,
                 from C:/Qt/Qt5.3.2/Tools/mingw482_32/i686-w64-mingw32/include/c
++/ostream:38,
                 from C:/Qt/Qt5.3.2/Tools/mingw482_32/i686-w64-mingw32/include/c
++/iostream:39,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkIOStream.h:33,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkSystemIncludes.h:36,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkIndent.h:25,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkObjectBase.h:44,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkObject.h:42,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkRenderPass.h:46,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.h:33,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.cxx:16:
C:/MinGW/include/stdlib.h:354:63: error: expression list treated as compound exp
ression in initializer [-fpermissive]
 _CRTIMP void* __cdecl __MINGW_NOTHROW calloc (size_t, size_t) __MINGW_ATTRIB_MA
LLOC;
                                                               ^
In file included from C:/VTK/VTK-6.3.0/Common/Core/vtkSystemIncludes.h:52:0,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkIndent.h:25,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkObjectBase.h:44,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkObject.h:42,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkRenderPass.h:46,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.h:33,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.cxx:16:
C:/MinGW/include/stdlib.h:355:53: warning: '__cdecl__' attribute only applies to
 function types [-Wattributes]
 _CRTIMP void* __cdecl __MINGW_NOTHROW malloc (size_t) __MINGW_ATTRIB_MALLOC;
                                                     ^
C:/MinGW/include/stdlib.h:355:53: warning: '__nothrow__' attribute ignored [-Wat
tributes]
C:/MinGW/include/stdlib.h:355:47: error: 'size_t' was not declared in this scope

 _CRTIMP void* __cdecl __MINGW_NOTHROW malloc (size_t) __MINGW_ATTRIB_MALLOC;
                                               ^
C:/MinGW/include/stdlib.h:355:47: note: suggested alternatives:
In file included from C:/Qt/Qt5.3.2/Tools/mingw482_32/i686-w64-mingw32/include/c
++/iostream:38:0,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkIOStream.h:33,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkSystemIncludes.h:36,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkIndent.h:25,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkObjectBase.h:44,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkObject.h:42,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkRenderPass.h:46,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.h:33,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.cxx:16:
C:/Qt/Qt5.3.2/Tools/mingw482_32/i686-w64-mingw32/include/c++/i686-w64-mingw32/bi
ts/c++config.h:186:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^
C:/Qt/Qt5.3.2/Tools/mingw482_32/i686-w64-mingw32/include/c++/i686-w64-mingw32/bi
ts/c++config.h:186:26: note:   'std::size_t'
In file included from C:/VTK/VTK-6.3.0/Common/Core/vtkSystemIncludes.h:52:0,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkIndent.h:25,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkObjectBase.h:44,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkObject.h:42,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkRenderPass.h:46,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.h:33,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.cxx:16:
C:/MinGW/include/stdlib.h:356:55: error: 'size_t' has not been declared
 _CRTIMP void* __cdecl __MINGW_NOTHROW realloc (void*, size_t);
                                                       ^
C:/MinGW/include/stdlib.h:368:58: error: 'size_t' has not been declared
 _CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t,
                                                          ^
C:/MinGW/include/stdlib.h:368:66: error: 'size_t' has not been declared
 _CRTIMP void* __cdecl bsearch (const void*, const void*, size_t, size_t,
                                                                  ^
C:/MinGW/include/stdlib.h:370:35: error: 'size_t' has not been declared
 _CRTIMP void __cdecl qsort(void*, size_t, size_t,
                                   ^
C:/MinGW/include/stdlib.h:370:43: error: 'size_t' has not been declared
 _CRTIMP void __cdecl qsort(void*, size_t, size_t,
                                           ^
C:/MinGW/include/stdlib.h:417:70: error: 'size_t' has not been declared
 _CRTIMP char* __cdecl __MINGW_NOTHROW _fullpath (char*, const char*, size_t);
                                                                      ^
In file included from C:/VTK/VTK-6.3.0/Common/Core/vtkSystemIncludes.h:53:0,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkIndent.h:25,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkObjectBase.h:44,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkObject.h:42,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkRenderPass.h:46,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.h:33,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.cxx:16:
C:/MinGW/include/string.h:36:65: error: 'size_t' has not been declared
 _CRTIMP void* __cdecl __MINGW_NOTHROW memchr (const void*, int, size_t) __MINGW
_ATTRIB_PURE;
                                                                 ^
C:/MinGW/include/string.h:37:72: error: 'size_t' has not been declared
 _CRTIMP int __cdecl __MINGW_NOTHROW  memcmp (const void*, const void*, size_t)
__MINGW_ATTRIB_PURE;
                                                                        ^
C:/MinGW/include/string.h:38:68: error: 'size_t' has not been declared
 _CRTIMP void* __cdecl __MINGW_NOTHROW  memcpy (void*, const void*, size_t);
                                                                    ^
C:/MinGW/include/string.h:39:68: error: 'size_t' has not been declared
 _CRTIMP void* __cdecl __MINGW_NOTHROW memmove (void*, const void*, size_t);
                                                                    ^
C:/MinGW/include/string.h:40:59: error: 'size_t' has not been declared
 _CRTIMP void* __cdecl __MINGW_NOTHROW memset (void*, int, size_t);
                                                           ^
C:/MinGW/include/string.h:46:9: error: 'size_t' does not name a type
 _CRTIMP size_t __cdecl __MINGW_NOTHROW strcspn (const char*, const char*)  __MI
NGW_ATTRIB_PURE;
         ^
C:/MinGW/include/string.h:49:9: error: 'size_t' does not name a type
 _CRTIMP size_t __cdecl __MINGW_NOTHROW strlen (const char*)  __MINGW_ATTRIB_PUR
E;
         ^
C:/MinGW/include/string.h:50:68: error: 'size_t' has not been declared
 _CRTIMP char* __cdecl __MINGW_NOTHROW strncat (char*, const char*, size_t);
                                                                    ^
C:/MinGW/include/string.h:51:72: error: 'size_t' has not been declared
 _CRTIMP int __cdecl __MINGW_NOTHROW strncmp (const char*, const char*, size_t)
 __MINGW_ATTRIB_PURE;
                                                                        ^
C:/MinGW/include/string.h:52:68: error: 'size_t' has not been declared
 _CRTIMP char* __cdecl __MINGW_NOTHROW strncpy (char*, const char*, size_t);
                                                                    ^
C:/MinGW/include/string.h:55:9: error: 'size_t' does not name a type
 _CRTIMP size_t __cdecl __MINGW_NOTHROW strspn (const char*, const char*)  __MIN
GW_ATTRIB_PURE;
         ^
C:/MinGW/include/string.h:58:9: error: 'size_t' does not name a type
 _CRTIMP size_t __cdecl __MINGW_NOTHROW strxfrm (char*, const char*, size_t);
         ^
C:/MinGW/include/string.h:65:74: error: 'size_t' has not been declared
 _CRTIMP void* __cdecl __MINGW_NOTHROW _memccpy (void*, const void*, int, size_t
);
                                                                          ^
C:/MinGW/include/string.h:66:74: error: 'size_t' has not been declared
 _CRTIMP int __cdecl __MINGW_NOTHROW  _memicmp (const void*, const void*, size_t
);
                                                                          ^
C:/MinGW/include/string.h:72:74: error: 'size_t' has not been declared
 _CRTIMP int __cdecl __MINGW_NOTHROW _strnicmp (const char*, const char*, size_t
);
                                                                          ^
C:/MinGW/include/string.h:73:61: error: 'size_t' has not been declared
 _CRTIMP char* __cdecl __MINGW_NOTHROW _strnset (char*, int, size_t);
                                                             ^
C:/MinGW/include/string.h:77:65: error: 'size_t' has not been declared
 _CRTIMP void __cdecl __MINGW_NOTHROW _swab (const char*, char*, size_t);
                                                                 ^
C:/MinGW/include/string.h:80:74: error: 'size_t' has not been declared
 _CRTIMP int __cdecl __MINGW_NOTHROW  _strncoll(const char*, const char*, size_t
);
                                                                          ^
C:/MinGW/include/string.h:81:75: error: 'size_t' has not been declared
 _CRTIMP int __cdecl __MINGW_NOTHROW  _strnicoll(const char*, const char*, size_
t);
                                                                           ^
C:/MinGW/include/string.h:90:73: error: 'size_t' has not been declared
 _CRTIMP void* __cdecl __MINGW_NOTHROW memccpy (void*, const void*, int, size_t)
;
                                                                         ^
C:/MinGW/include/string.h:91:72: error: 'size_t' has not been declared
 _CRTIMP int __cdecl __MINGW_NOTHROW memicmp (const void*, const void*, size_t);

                                                                        ^
C:/MinGW/include/string.h:103:73: error: 'size_t' has not been declared
 _CRTIMP int __cdecl __MINGW_NOTHROW strnicmp (const char*, const char*, size_t)
;
                                                                         ^
C:/MinGW/include/string.h:104:71: error: 'size_t' has not been declared
 int  __cdecl __MINGW_NOTHROW strncasecmp (const char *, const char *, size_t);
                                                                       ^
C:/MinGW/include/string.h:107:54: error: 'size_t' has not been declared
 strncasecmp (const char * __sz1, const char * __sz2, size_t __sizeMaxCompare)
                                                      ^
C:/MinGW/include/string.h:110:60: error: 'size_t' has not been declared
 _CRTIMP char* __cdecl __MINGW_NOTHROW strnset (char*, int, size_t);
                                                            ^
C:/MinGW/include/string.h:115:64: error: 'size_t' has not been declared
 _CRTIMP void __cdecl __MINGW_NOTHROW swab (const char*, char*, size_t);
                                                                ^
In file included from C:/VTK/VTK-6.3.0/Common/Core/vtkAtomicTypes.h:18:0,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkObjectBase.h:46,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkObject.h:42,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkRenderPass.h:46,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.h:33,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.cxx:16:
C:/VTK/build/Common/Core/vtkAtomic.h:85:11: error: 'size_t' has not been declare
d
 template <size_t size> class AtomicOps;
           ^
In file included from C:/VTK/VTK-6.3.0/Common/Core/vtkObject.h:42:0,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkRenderPass.h:46,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.h:33,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.cxx:16:
C:/VTK/VTK-6.3.0/Common/Core/vtkObjectBase.h:117:23: error: declaration of 'oper
ator new' as non-function
   void* operator new( size_t tSize );
                       ^
C:/VTK/VTK-6.3.0/Common/Core/vtkObjectBase.h:117:18: error: expected ';' at end
of member declaration
   void* operator new( size_t tSize );
                  ^
C:/VTK/VTK-6.3.0/Common/Core/vtkObjectBase.h:117:30: error: expected ')' before
'tSize'
   void* operator new( size_t tSize );
                              ^
In file included from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkRenderPass.h:46:0,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.h:33,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.cxx:16:
C:/VTK/VTK-6.3.0/Common/Core/vtkObject.h:62:23: error: declaration of 'operator
new' as non-function
   void* operator new( size_t tSize );
                       ^
C:/VTK/VTK-6.3.0/Common/Core/vtkObject.h:62:18: error: expected ';' at end of me
mber declaration
   void* operator new( size_t tSize );
                  ^
C:/VTK/VTK-6.3.0/Common/Core/vtkObject.h:62:30: error: expected ')' before 'tSiz
e'
   void* operator new( size_t tSize );
                              ^
In file included from C:/VTK/VTK-6.3.0/Common/Core/vtkObject.h:43:0,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkRenderPass.h:46,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.h:33,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.cxx:16:
C:/VTK/VTK-6.3.0/Common/Core/vtkWindow.h: In member function 'virtual void vtkWi
ndow::SetWindowName(const char*)':
C:/VTK/VTK-6.3.0/Common/Core/vtkSetGet.h:112:5: error: 'size_t' was not declared
 in this scope
     size_t n = strlen(_arg) + 1; \
     ^
C:/VTK/VTK-6.3.0/Common/Core/vtkWindow.h:96:3: note: in expansion of macro 'vtkS
etStringMacro'
   vtkSetStringMacro(WindowName);
   ^
C:/VTK/VTK-6.3.0/Common/Core/vtkSetGet.h:112:5: note: suggested alternatives:
     size_t n = strlen(_arg) + 1; \
     ^
C:/VTK/VTK-6.3.0/Common/Core/vtkWindow.h:96:3: note: in expansion of macro 'vtkS
etStringMacro'
   vtkSetStringMacro(WindowName);
   ^
In file included from C:/Qt/Qt5.3.2/Tools/mingw482_32/i686-w64-mingw32/include/c
++/iostream:38:0,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkIOStream.h:33,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkSystemIncludes.h:36,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkIndent.h:25,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkObjectBase.h:44,
                 from C:/VTK/VTK-6.3.0/Common/Core/vtkObject.h:42,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkRenderPass.h:46,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.h:33,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.cxx:16:
C:/Qt/Qt5.3.2/Tools/mingw482_32/i686-w64-mingw32/include/c++/i686-w64-mingw32/bi
ts/c++config.h:186:26: note:   'std::size_t'
   typedef __SIZE_TYPE__  size_t;
                          ^
C:/Qt/Qt5.3.2/Tools/mingw482_32/i686-w64-mingw32/include/c++/i686-w64-mingw32/bi
ts/c++config.h:186:26: note:   'std::size_t'
In file included from C:/VTK/VTK-6.3.0/Common/Core/vtkObject.h:43:0,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkRenderPass.h:46,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.h:33,
                 from C:\VTK\VTK-6.3.0\Rendering\OpenGL\vtkCameraPass.cxx:16:
C:/VTK/VTK-6.3.0/Common/Core/vtkSetGet.h:112:12: error: expected ';' before 'n'
     size_t n = strlen(_arg) + 1; \
            ^
C:/VTK/VTK-6.3.0/Common/Core/vtkWindow.h:96:3: note: in expansion of macro 'vtkS
etStringMacro'
   vtkSetStringMacro(WindowName);
   ^
C:/VTK/VTK-6.3.0/Common/Core/vtkSetGet.h:113:27: error: 'n' was not declared in
this scope
     char *cp1 =  new char[n]; \
                           ^
C:/VTK/VTK-6.3.0/Common/Core/vtkWindow.h:96:3: note: in expansion of macro 'vtkS
etStringMacro'
   vtkSetStringMacro(WindowName);
   ^
Rendering\OpenGL\CMakeFiles\vtkRenderingOpenGL.dir\build.make:183: recipe for ta
rget 'Rendering/OpenGL/CMakeFiles/vtkRenderingOpenGL.dir/vtkCameraPass.cxx.obj'
failed
mingw32-make[2]: *** [Rendering/OpenGL/CMakeFiles/vtkRenderingOpenGL.dir/vtkCame
raPass.cxx.obj] Error 1
CMakeFiles\Makefile2:4267: recipe for target 'Rendering/OpenGL/CMakeFiles/vtkRen
deringOpenGL.dir/all' failed
mingw32-make[1]: *** [Rendering/OpenGL/CMakeFiles/vtkRenderingOpenGL.dir/all] Er
ror 2
Makefile:126: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

0 个答案:

没有答案