# Why do I get build error "class vtkOBJExporter has no member named SetOBJFileComment" when building Slicer against Qt4?

**URL:** https://discourse.slicer.org/t/why-do-i-get-build-error-class-vtkobjexporter-has-no-member-named-setobjfilecomment-when-building-slicer-against-qt4/2482
**Category:** Development
**Tags:** build
**Created:** [March 30, 2018, 11:00pm UTC](https://discourse.slicer.org/t/why-do-i-get-build-error-class-vtkobjexporter-has-no-member-named-setobjfilecomment-when-building-slicer-against-qt4/2482 "2018-03-30T23:00:56Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![gaoyi.cn](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/gaoyi.cn/32/1422_2.png) [@gaoyi.cn](https://discourse.slicer.org/u/gaoyi.cn)
#### Post date: [March 30, 2018, 11:00pm UTC](https://discourse.slicer.org/t/why-do-i-get-build-error-class-vtkobjexporter-has-no-member-named-setobjfilecomment-when-building-slicer-against-qt4/2482/1 "2018-03-30T23:00:56Z")

</div>

On linux mint/ubuntu 16.04, GCC 5.4.0

I got error:

[24%] Building CXX object Libs/MRML/Core/CMakeFiles/MRMLCore.dir/vtkMRMLProceduralColorNode.cxx.o  
/home/gaoyi/usr/work/namic/rls20180330/Slicer/Libs/MRML/Core/vtkMRMLModelStorageNode.cxx: In member function ‘virtual int vtkMRMLModelStorageNode::WriteDataInternal(vtkMRMLNode\*)’:  
/home/gaoyi/usr/work/namic/rls20180330/Slicer/Libs/MRML/Core/vtkMRMLModelStorageNode.cxx:504:15: error: ‘class vtkOBJExporter’ has no member named ‘SetOBJFileComment’  
exporter-\>SetOBJFileComment(header.c\_str());  
^  
[24%] Building CXX object Libs/MRML/Core/CMakeFiles/MRMLCore.dir/vtkMRMLProceduralColorStorageNode.cxx.o  
[24%] Building CXX object Libs/MRML/Core/CMakeFiles/MRMLCore.dir/vtkMRMLROIListNode.cxx.o  
Libs/MRML/Core/CMakeFiles/MRMLCore.dir/build.make:998: recipe for target ‘Libs/MRML/Core/CMakeFiles/MRMLCore.dir/vtkMRMLModelStorageNode.cxx.o’ failed  
make[5]: \*\*\* [Libs/MRML/Core/CMakeFiles/MRMLCore.dir/vtkMRMLModelStorageNode.cxx.o] Error 1  
make[5]: \*\*\* Waiting for unfinished jobs…  
CMakeFiles/Makefile2:1275: recipe for target ‘Libs/MRML/Core/CMakeFiles/MRMLCore.dir/all’ failed  
make[4]: \*\*\* [Libs/MRML/Core/CMakeFiles/MRMLCore.dir/all] Error 2  
make[4]: \*\*\* Waiting for unfinished jobs…  
[24%] Linking CXX static library …/…/…/lib/Slicer-4.9/libBRAINSDemonWarpTemplatesLIB.a  
[24%] Built target BRAINSDemonWarpTemplatesLIB  
Makefile:149: recipe for target ‘all’ failed  
make[3]: \*\*\* [all] Error 2  
CMakeFiles/Slicer.dir/build.make:142: recipe for target ‘Slicer-prefix/src/Slicer-stamp/Slicer-build’ failed  
make[2]: \*\*\* [Slicer-prefix/src/Slicer-stamp/Slicer-build] Error 2  
CMakeFiles/Makefile2:96: recipe for target ‘CMakeFiles/Slicer.dir/all’ failed  
make[1]: \*\*\* [CMakeFiles/Slicer.dir/all] Error 2  
Makefile:83: recipe for target ‘all’ failed  
make: \*\*\* [all] Error 2

Yesterday it was fine so I checked the git log, seems there are some major changes with VTK in 4ac140217b2b564c7fed7226706616d8523bb4b1

Thanks for any hint!

Best,  
yi

---

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [March 30, 2018, 11:14pm UTC](https://discourse.slicer.org/t/why-do-i-get-build-error-class-vtkobjexporter-has-no-member-named-setobjfilecomment-when-building-slicer-against-qt4/2482/2 "2018-03-30T23:14:38Z")

</div>

This happens because you build Slicer against Qt4 + VTK7.

I suggest you build against Qt5. Simply doing a clean build passing `-DQt5_DIR:PATH=/path/to/lib/cmake/Qt5` should be sufficient.

That said, I will fix the error because code up to the next release (Slicer 4.10.0) that will be cut tonight or tomorrow will be the last one to support compiling against both Qt4/VTK7 and Qt5/VTK9.

---

<div class="post-metadata">

### Author: ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)
#### Post date: [March 30, 2018, 11:36pm UTC](https://discourse.slicer.org/t/why-do-i-get-build-error-class-vtkobjexporter-has-no-member-named-setobjfilecomment-when-building-slicer-against-qt4/2482/3 "2018-03-30T23:36:48Z")

</div>

2 posts were split to a new topic: [Should I build Qt 5.10 from source on Linux?](https://discourse.slicer.org/t/should-i-build-qt-5-10-from-source-on-linux/2484)
