# vtkScalarBarActor New macro problem

**URL:** https://discourse.vtk.org/t/vtkscalarbaractor-new-macro-problem/610
**Category:** Development
**Created:** [March 26, 2019, 5:55pm UTC](https://discourse.vtk.org/t/vtkscalarbaractor-new-macro-problem/610 "2019-03-26T17:55:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ramon.j.moral](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/e56c9b/32.png) [@ramon.j.moral](https://discourse.vtk.org/u/ramon.j.moral)
#### Post date: [March 26, 2019, 5:55pm UTC](https://discourse.vtk.org/t/vtkscalarbaractor-new-macro-problem/610/1 "2019-03-26T17:55:12Z")

</div>

Hello,

I am using QtCreator to make a vtk App. I wanted to make a section of the app that shows the vtkScalarBarActor so the USER can get a feeling for the colors their going to use for their state plot.

I have two lines in the showEvent handler for the QVTKOpenGLWidget were the color bar will live:  
vtkSmartPointer lut = vtkSmartPointer::New();  
vtkSmartPointer bar = vtkSmartPointer::New();

So there is no problem with the vtkLookupTable. But the vtkScalarBarActor throws the following:

/usr/local/vtk-8/include/vtk-8.2/vtkSmartPointer.h:155: error: undefined reference to `vtkScalarBarActor::New()’

Any ideas? Any help is greatly appreciated.

---

<div class="post-metadata">

### Author: ![ramon.j.moral](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/r/e56c9b/32.png) [@ramon.j.moral](https://discourse.vtk.org/u/ramon.j.moral)
#### Post date: [March 26, 2019, 6:56pm UTC](https://discourse.vtk.org/t/vtkscalarbaractor-new-macro-problem/610/2 "2019-03-26T18:56:19Z")

</div>

I am sorry I forgot the first part of the error:  
/home/rmoral/Documents/dev/Qt/build-igvnapp-Desktop-Debug/igcolorbarviewer.o:-1: In function `vtkSmartPointer::New()’:

Thank you again.

---

<div class="post-metadata">

### Author: ![allison.vacanti](https://discourse.vtk.org/user_avatar/discourse.vtk.org/allison.vacanti/32/679_2.png) [@allison.vacanti](https://discourse.vtk.org/u/allison.vacanti)
#### Post date: [March 26, 2019, 10:07pm UTC](https://discourse.vtk.org/t/vtkscalarbaractor-new-macro-problem/610/3 "2019-03-26T22:07:02Z")

</div>

`vtkScalarBarActor::New()` is defined in the `vtkRenderingAnnotation` library – make sure you’ve linked this library to your application.
