# undefined reference to 'ZN16QVTKOpenGLWidget'

**URL:** https://discourse.vtk.org/t/undefined-reference-to-zn16qvtkopenglwidget/4024
**Category:** Support
**Created:** [August 19, 2020, 6:07pm UTC](https://discourse.vtk.org/t/undefined-reference-to-zn16qvtkopenglwidget/4024 "2020-08-19T18:07:23Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Cesar\_Cherre](https://discourse.vtk.org/user_avatar/discourse.vtk.org/cesar_cherre/32/2216_2.png) [@Cesar\_Cherre](https://discourse.vtk.org/u/Cesar_Cherre)
#### Post date: [August 19, 2020, 6:07pm UTC](https://discourse.vtk.org/t/undefined-reference-to-zn16qvtkopenglwidget/4024/1 "2020-08-19T18:07:23Z")

</div>

Hi everyone, I have successfully installed VTK with MinGW64, I have imported the .dll and .h into .pro, but when I run a test code I get this:

“…mainwindow.cpp:16: error: undefined reference to ‘imp\_\_ZN16QVTKOpenGLWidgetC1EP7QWidget6QFlagsIN2Qt10WindowTypeEE’”

Line 16:

QVTKOpenGLWidget \* widget = new QVTKOpenGLWidget(this);

---

<div class="post-metadata">

### Author: ![yuhuimoon](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/y/c6cbf5/32.png) [@yuhuimoon](https://discourse.vtk.org/u/yuhuimoon)
#### Post date: [August 22, 2020, 3:02am UTC](https://discourse.vtk.org/t/undefined-reference-to-zn16qvtkopenglwidget/4024/2 "2020-08-22T03:02:59Z")

</div>

It looks like a compile problem. Check the .pro file that it contains the correct statement of .lib(or .a) files, like the this:

`LIBS += C:\VTK\VTK-9.0.1_mingw_debug\lib\lib*.*`

And the path of VTK(like “C:\VTK\VTK-9.0.1\_mingw\_debug\bin”) contains .dll files should be added to the building environment in Qt Creator or path environment of your system, or you can copy the .dll files to the directory of your App.
