# About vtkCellArray::InsertNextCell()

**URL:** https://discourse.vtk.org/t/about-vtkcellarray-insertnextcell/7969
**Category:** Support
**Created:** [March 3, 2022, 1:18pm UTC](https://discourse.vtk.org/t/about-vtkcellarray-insertnextcell/7969 "2022-03-03T13:18:16Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![zxlice](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/eb9ed0/32.png) [@zxlice](https://discourse.vtk.org/u/zxlice)
#### Post date: [March 3, 2022, 1:18pm UTC](https://discourse.vtk.org/t/about-vtkcellarray-insertnextcell/7969/1 "2022-03-03T13:18:16Z")

</div>

Why undefined error?

```auto
line->GetPointIds()->SetId(0, 0);
line->GetPointIds()->SetId(0, 1);
vtkNew<vtkCellArray> cells;
cells->InsertNextCell(line);

build information: vtk-9.1 with MinGW8.1 

Here is the compile error infomation:
CMakeFiles/LearnVtk.dir/main.cpp.obj: In function `vtkGenericDataArray<vtkAOSDataArrayTemplate<int>, int>::SetValue(long long, int)':

CMakeFiles/LearnVtk.dir/main.cpp.obj: In function `vtkGenericDataArray<vtkAOSDataArrayTemplate<long long>, long long>::SetValue(long long, long long)':
```

---

<div class="post-metadata">

### Author: ![Yohann\_Bearzi](https://discourse.vtk.org/user_avatar/discourse.vtk.org/yohann_bearzi/32/671_2.png) [@Yohann\_Bearzi](https://discourse.vtk.org/u/Yohann_Bearzi)
#### Post date: [March 3, 2022, 1:46pm UTC](https://discourse.vtk.org/t/about-vtkcellarray-insertnextcell/7969/2 "2022-03-03T13:46:29Z")

</div>

Could you display the full error for each instance? The error ends with a column, which seems to indicate there’s more to it. In the meantime, can you try:

```auto
#include <vtkTypeInt64Array.h>
#include <vtkTypeInt32Array.h>

```

---

<div class="post-metadata">

### Author: ![zxlice](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/eb9ed0/32.png) [@zxlice](https://discourse.vtk.org/u/zxlice)
#### Post date: [March 3, 2022, 1:59pm UTC](https://discourse.vtk.org/t/about-vtkcellarray-insertnextcell/7969/3 "2022-03-03T13:59:32Z")

</div>

Hi, Thanks for your reply. I’m using example in this page:

`https://kitware.github.io/vtk-examples/site/Cxx/GeometricObjects/ColoredLines/`

other examples without this function works fine.

I’ve tried include headers suggested, but still not work, here is the full error information:

```auto
FAILED: LearnVtk.exe 
cmd.exe /C "cd . && D:\Dev\Qt\Qt5.15.2\Tools\mingw810_64\bin\g++.exe -g @CMakeFiles\LearnVtk.rsp -o LearnVtk.exe -Wl,--out-implib,libLearnVtk.dll.a -Wl,--major-image-version,0,--minor-image-version,0 && cd ."
CMakeFiles/LearnVtk.dir/main.cpp.obj: In function `vtkGenericDataArray<vtkAOSDataArrayTemplate<long long>, long long>::SetValue(long long, long long)':
D:/Dev/VTK/include/vtk-9.1/vtkGenericDataArray.h:122: undefined reference to `vtkAOSDataArrayTemplate<long long>::SetValue(long long, long long)'
CMakeFiles/LearnVtk.dir/main.cpp.obj: In function `vtkGenericDataArray<vtkAOSDataArrayTemplate<int>, int>::SetValue(long long, int)':
D:/Dev/VTK/include/vtk-9.1/vtkGenericDataArray.h:122: undefined reference to `vtkAOSDataArrayTemplate<int>::SetValue(long long, int)'
CMakeFiles/LearnVtk.dir/main.cpp.obj: In function `vtkGenericDataArray<vtkAOSDataArrayTemplate<unsigned char>, unsigned char>::SetTypedTuple(long long, unsigned char const*)':
D:/Dev/VTK/include/vtk-9.1/vtkGenericDataArray.h:150: undefined reference to `vtkAOSDataArrayTemplate<unsigned char>::SetTypedTuple(long long, unsigned char const*)'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
21:55:48: Process "D:\Dev\Qt\Qt5.15.2\Tools\CMake_64\bin\cmake.exe"Exit，退exit code 1 。
Error while building/deploying project LearnVtk (kit: Desktop Qt 5.15.2 MinGW 64-bit)
When executing step "Build"
21:55:48: Elapsed time: 00:00.
```

---

<div class="post-metadata">

### Author: ![zxlice](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/eb9ed0/32.png) [@zxlice](https://discourse.vtk.org/u/zxlice)
#### Post date: [March 7, 2022, 12:45am UTC](https://discourse.vtk.org/t/about-vtkcellarray-insertnextcell/7969/4 "2022-03-07T00:45:07Z")

</div>

It solved compiled with MSVC. Seems compiler issue
