Error during generation with Visual Studio

Hello everyone,
I’m new to 3d slicer so maybe I’m doing it wrong but this is the error I get :

image

I tried several time to build the project with CMAKE and Visual Studio on two differents computers(Windows 10 and 11)

Regards,
Michael

Hello everyone,
I’m new to 3d slicer so maybe I’m doing it wrong but this is the error I get :
image

I tried several time to build the project with CMAKE and Visual Studio on two differents computers(Windows 10 and 11)

Regards,
Michael

@Shoshoda are you getting only, this ONE error?

Yes only this one, on both computer

Still, this is very little information. A full log would definitely help.

Has the build otherwise succeed btw? Because I have seen similar errors (although I don’t speak French and from your screenshot I cannot copy-paste, so cannot say if the message itself is the same or not) in otherwise successful builds that then allowed running and debugging Slicer without problems.

Yes sorry I didn’t notice that my screenshot was in french. There is copy-paste of the screenshot :

|Erreur|MSB8066|la build personnalisée de ‘C:\D\S4R\CMakeFiles\26b24c13142eddf123c97e3494499225\Slicer-configure.rule;C:\D\S4R\CMakeFiles\26b24c13142eddf123c97e3494499225\Slicer-build.rule;C:\D\S4R\CMakeFiles\26b24c13142eddf123c97e3494499225\Slicer-forceconfigure.rule;C:\D\S4R\CMakeFiles\26b24c13142eddf123c97e3494499225\Slicer-install.rule;C:\D\S4R\CMakeFiles\d0fbb327fb5d8976f542b004b1325aa2\Slicer-complete.rule;C:\D\S4R\CMakeFiles\dbe9d635f197b17f63b9c895eaab2164\Slicer.rule’ s’est arrêtée. Code 1.|Slicer|C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets|245||


And here are the logs I get :

Performing configure step for ‘Slicer’
loading initial cache file C:/D/S4R/Slicer-prefix/tmp/Slicer-cache-Release.cmake
– Setting C++ standard
– Setting C++ standard - C++14
– Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.19043.

Slicer should not be configured & built in the Slicer source directory
You must run cmake in a build directory.
For example:
mkdir Slicer-sandbox ; cd Slicer-sandbox
git clone GitHub - Slicer/Slicer: Multi-platform, free open source software for visualization and image computing. # or download & unpack the source tarball
mkdir Slicer-SuperBuild
this will create the following directory structure

Slicer-sandbox
±-Slicer
±-Slicer-SuperBuild

Then you can proceed to configure and build
by using the following commands

cd Slicer-SuperBuild
cmake …/Slicer # or ccmake, or cmake-gui
make

NOTE: Given that you already tried to make an in-source build
CMake have already created several files & directories
in your source tree. run ‘git status’ to find them and
remove them by doing:

    cd Slicer-sandbox/Slicer
    git clean -n -d
    git clean -f -d
    git checkout --

CMake Error at CMake/PreventInSourceBuilds.cmake:42 (message):
Quitting configuration
Call Stack (most recent call first):
CMake/PreventInSourceBuilds.cmake:46 (AssureOutOfSourceBuilds)
CMakeLists.txt:93 (include)

– Configuring incomplete, errors occurred!
See also “C:/D/S4/CMakeFiles/CMakeOutput.log”.
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(245,5): error MSB8066: la build personnalisée de ‘C:\D\S4R\CMakeFiles\26b24c13142eddf123c97e3494499225\Slicer-configure.rule;C:\D\S4R\CMakeFiles\26b24c13142eddf123c97e3494499225\Slicer-build.rule;C:\D\S4R\CMakeFiles\26b24c13142eddf123c97e3494499225\Slicer-forceconfigure.rule;C:\D\S4R\CMakeFiles\26b24c13142eddf123c97e3494499225\Slicer-install.rule;C:\D\S4R\CMakeFiles\d0fbb327fb5d8976f542b004b1325aa2\Slicer-complete.rule;C:\D\S4R\CMakeFiles\dbe9d635f197b17f63b9c895eaab2164\Slicer.rule’ s’est arrêtée. Code 1.

This looks like a good next point of attention.

So it’s now working !
I was working on two different folder like the doc say : C:\D\S4 and C:\D\S4R
but It’s wasn’t working.
So I tried C:\D\S4\Slicer with the sources code and it’s finaly working fine.

Thanks for your help

Michael

It is great to hear this!

It seems that the problem was that you checked out the source code into C:\D\S4\Slicer instead of C:\D\S4. This most likely happened because you have forgot the . from the command that was described in the build instructions: git clone https://github.com/Slicer/Slicer.git . (if you don’t have the . in the end then a Slicer subfolder is created).