Visual Studio compiler cannot find the include file

mauede 221 Reputation points
2023-07-09T23:30:01.48+00:00

Last week VS 2022 pre-processor could not find the VTK include files.

I was advised to change the VS configuration from Debug to Release. That fixed the problem.

Now the compiler throws the error C083 stating it cannot open "C:\System File\VTK\include\vtk-9.2 file not found".

However, such a file does exist. I checked with Windows Explorer and double-checked with the CMD terminal.

I also printed out my user environment variable PATH with the CMD terminal.

The file that VS cannot find is the last item of the paths chain that makes up the value of the environment variable PATH

Shall I store VTK include files in my home folder rather than in System Files?

Thank you.C1083

Developer technologies Visual Studio Other
{count} votes

1 answer

Sort by: Most helpful
  1. mauede 221 Reputation points
    2023-07-17T21:10:16.3633333+00:00

    Thank you.

    The reported problem has been overcome. Now I am stuck at runtime.

    I downloaded a couple of C++ graphic examples from https://examples.vtk.org/site/Cxx/#geometric-objects

    I followed the procedure outlined on [https://gitlab.kitware.com/vtk/vtk/-/blob/master/Documentation/dev/build_windows_vs.md)] in the section entitled "Test with an example". I got no error from CMake. No error from Visual Studio. When I run the executable I get a black window tha is supposed to show the geometric object. I tried "Cylinder", "EathSource", "Dodecahedron". I got the same result by starting Visual Studio and opening the folder where I had downloaded the C++ source code and the CMakeList.txt for the object I picked. VS builds the cmake cache with cmake variable that look all OK to me. Again, no compilation and no buil error. Not even runtime error but the popup window is completely black instead of showing the chosen graphic object.

    I also tried to use CMake from command line as follows:

    Directory: C:\Users\MMONVILL\Desktop\Test_VTK\EarthSource
    

    Mode LastWriteTime Length Name


    d----- 17/07/2023 21:08 build -a---- 04/07/2022 00:20 795 CMakeLists.txt -a---- 04/07/2022 00:20 2166 EarthSource.cxx

    PS C:\Users\MMONVILL\Desktop\Test_VTK\EarthSource> cmake -S C:\Users\MMONVILL\Desktop\Test_VTK\EarthSource -B C:\Users\MMONVILL\Desktop\Test_VTK\EarthSource\build -- Building for: Visual Studio 17 2022 -- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19045. -- The C compiler identification is MSVC 19.36.32537.0 -- The CXX compiler identification is MSVC 19.36.32537.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - not found -- Found Threads: TRUE -- Found OpenGL: opengl32 found components: OpenGL -- Configuring done (11.0s) -- Generating done (0.1s) -- Build files have been written to: C:/Users/MMONVILL/Desktop/Test_VTK/EarthSource/build PS C:\Users\MMONVILL\Desktop\Test_VTK\EarthSource> ls

    Directory: C:\Users\MMONVILL\Desktop\Test_VTK\EarthSource
    

    Mode LastWriteTime Length Name


    d----- 17/07/2023 21:13 build -a---- 04/07/2022 00:20 795 CMakeLists.txt -a---- 04/07/2022 00:20 2166 EarthSource.cxx

    PS C:\Users\MMONVILL\Desktop\Test_VTK\EarthSource> cd build PS C:\Users\MMONVILL\Desktop\Test_VTK\EarthSource\build> ls

    Directory: C:\Users\MMONVILL\Desktop\Test_VTK\EarthSource\build
    

    Mode LastWriteTime Length Name


    d----- 17/07/2023 21:13 CMakeFiles -a---- 17/07/2023 21:13 53829 ALL_BUILD.vcxproj -a---- 17/07/2023 21:13 301 ALL_BUILD.vcxproj.filters -a---- 17/07/2023 21:13 15154 CMakeCache.txt -a---- 17/07/2023 21:13 1480 cmake_install.cmake -a---- 17/07/2023 21:13 3122 EarthSource.sln -a---- 17/07/2023 21:13 75475 EarthSource.vcxproj -a---- 17/07/2023 21:13 612 EarthSource.vcxproj.filters -a---- 17/07/2023 21:13 53897 ZERO_CHECK.vcxproj -a---- 17/07/2023 21:13 544 ZERO_CHECK.vcxproj.filters

    Then I opened the generated solution file with VS. I built the solution. No error. At runtime, though, I get the error message "Loadlibrary failed with error 87:The parameter is incorrect". The pop up window is black as usual.

    enter image description here

    I suspect there is a problem between CMake and Visual Studio...?

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.