I am trying to configure VTK with VS 2015 on win10 x64 . I downloaded VTK-8.1.0 source, created VS2015 project with cmake and build it with Visual Studio IDE. To test, I downloaded the sphere visualization code and created a VS2015 project with cmake and build it with VS2015 IDE. Everything is successfull. I run the .exe created from vtkproject/build/debug/.exe and I get the output as expected. Its displays a sphere. But when I run the program from the IDE, it gives runtime error as shown below:

I also tried using the pre-built VTK-7.0 binaries which were a part of PCL pre-built x64 binaries for VS2015 from this blog and tested the above mentioned sphere visualization program. Build seems to work and again I get the expected output from running the .exe created in vtkproject/build/debug/.exe but I get another runtime error when trying to run program from VS IDE as shown below:
.
I saw a similar post here but the accepted answer doesn't work for me.
Kindly help me regarding this issue.
I solved the problem thanks to Jesper Juhl hint. CWD was correct but it was none the less a directory path problem.
The first error occurred because in project properties->configuration manager, the build option against ALL_Build was unchecked.
The second error occurred because in ALL_BUILD project properties-> configuration properties->Debugging->Command was set to x64/Debug/ALL_BUILD. It should be set to Debug/Sphere.exe (Debug in the solution folder, not in x64)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With