Build ITK-SNAP keep fails

439 views
Skip to first unread message

Dongha Kang

unread,
Apr 2, 2021, 8:17:08 AM4/2/21
to itksnap-users
Hello, 

I used ITKSNAP on macOS environment and now I wanted to create executable for windows os. However, I could not fix the error....

I am currently using 
- windows 10, 64-bit
- Microsoft Visual Studio 2017
- CMake version 3.16.0-rc3
- ITK version 4.13.3
- VTK version 6.3.0
- QT version 5.9.9, used online downloader (also tried 5.12 since I was able to build and compile in macOS. However, I failed miserably in windows 10... In addition, when I tried to run source code for QT v5.6.0 it gave me another error message so I couldn't even create Qt v5.6.0.. Since this is not Qt forum I will not get into details).

My CMake was set up as 
ITK_DIR - ...itk/build   (compiled successfully)
VTK_DIR - ...vtk/build   
CMAKE_PREFIX_PATH - C:/Qt/5.12.2/msvc2017_64/lib/cmake (tried C:/Qt/5.9.9/msvc2017_64/lib/cmake also)

and the error messages that showed up were..
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CURL_LIBRARY
    linked by target "itksnapui_qt" in directory C:/Users/DELL/Desktop/itksnap-v2/itksnap-v2
    linked by target "itksnapui_model" in directory C:/Users/DELL/Desktop/itksnap-v2/itksnap-v2
    linked by target "itksnaplogic" in directory C:/Users/DELL/Desktop/itksnap-v2/itksnap-v2
    linked by target "ITK-SNAP" in directory C:/Users/DELL/Desktop/itksnap-v2/itksnap-v2
    linked by target "logic_api_test" in directory C:/Users/DELL/Desktop/itksnap-v2/itksnap-v2
    linked by target "Test_OrientationWidget" in directory C:/Users/DELL/Desktop/itksnap-v2/itksnap-v2
    linked by target "itksnap-wt" in directory C:/Users/DELL/Desktop/itksnap-v2/itksnap-v2/Utilities/Workspace

Configuring incomplete, errors occurred!

If anyone has any solutions for this problem, that will be awesome. Thank you!

Jilei Hao

unread,
Apr 2, 2021, 11:38:31 AM4/2/21
to itksna...@googlegroups.com
Hi Dongha,

Which branch of itksnap are you trying to build?

Best,
Jilei

--
You received this message because you are subscribed to the Google Groups "itksnap-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to itksnap-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/itksnap-users/415cd296-2e08-4423-b1d0-8203a57c2714n%40googlegroups.com.


--
Jilei Hao
Application Developer Sr.
Penn Image Computing and Science Lab
University of Pennsylvania

강동하

unread,
Apr 2, 2021, 12:25:00 PM4/2/21
to itksna...@googlegroups.com
Hi, jilei. 

I believe it was the newest itksnap. The master branch of  itksnap that i forked.  
It worked well in macOS. Will that be a problem in Windows ?

Thanks, 
Dongha

2021년 4월 3일 (토) 오전 12:38, Jilei Hao <jile...@gmail.com>님이 작성:
You received this message because you are subscribed to a topic in the Google Groups "itksnap-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/itksnap-users/USU2EkKZfrg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to itksnap-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/itksnap-users/CABsSX%2B%3Dp%3DgZytX9itG9sXp6tAY7oR6t8evUWMO%3DPyV4o%3Di22OQ%40mail.gmail.com.

Paul Yushkevich

unread,
Apr 2, 2021, 3:04:59 PM4/2/21
to itksna...@googlegroups.com
You need to install libcurl: https://curl.se/windows/

Best,
Paul





--
Paul A. Yushkevich, Ph.D.
Professor of Radiology
Penn Image Computing and Science Laboratory
University of Pennsylvania Perelman School of Medicine

Dongha Kang

unread,
Apr 6, 2021, 1:42:10 AM4/6/21
to itksnap-users
Thank you for your suggestion Paul, 

I guess it had to do something with the version of ITK-SNAP also, so downloading other version of ITK-SNAP and downloading libcurl did dismiss the error that I posted previously.
However, I get the new error, and this error occurred in every version of ITK-SNAP. Error goes like this in MSVC 2017

Error        C3688 invalid literal suffix 'Ctrl'; literal operator or literal operator template 'operator ""Ctrl' not found itksnapui_qt C:\...itksnap\GUI\Qt\Components\SNAPQtCommon.cxx 560
Error C2001 newline in constant itksnapui_qt C:\...itksnap\GUI\Qt\Components\SNAPQtCommon.cxx 560
Error C2146 syntax error: missing ')' before identifier 'tooltip' itksnapui_qt C:\...itksnap\GUI\Qt\Components\SNAPQtCommon.cxx 561
Error C2661 'QString::replace': no overloaded function takes 1 arguments itksnapui_qt C:\...itksnap\GUI\Qt\Components\SNAPQtCommon.cxx 560
Error C2146 syntax error: missing ';' before identifier 'tooltip' itksnapui_qt C:\...itksnap\GUI\Qt\Components\SNAPQtCommon.cxx 561

I am using msvc2017 (64bit), I tried with QT version 5.12.2, and 5.9.9. I tried with msvc2019 (64bit) with QT version of 5.15.2 also.
Any suggestions? 

Thank you
Dongha

Dongha Kang

unread,
Apr 6, 2021, 4:24:12 AM4/6/21
to itksnap-users
Sorry I am just talking....

I was able to fix that by changing "^" to QChar(0x2303) in SNAPQtCommon.cxx and also, I got a bunch of errors saying binary '<<' no operator found which takes a right-hand operand of type .. in main.cxx. I was able to fix that by erasing using namespace std; and add std:: in front of all the iostream commands.. 
I don't know why this is happening. 

Currently working on the error that says 
severity code description project file line suppression state error msb6003 the specified task executable "rc.exe" could not be run. the filename or extension is too long itk-snap c:\program files\microsoft visual studio\2017\community\common7\ide\vc\vctargets\microsoft.cppcommon.targets 1498
Is anyone having a same issue or Am I just going to the wrong direction ;(

Dongha 

Jilei Hao

unread,
Apr 6, 2021, 9:31:26 AM4/6/21
to itksna...@googlegroups.com
Hi Dongha,

We haven't tested windows build for ITK-SNAP using msvc 2017 and above. 

Please use msvc 2015-64 for master and seg-4d branch, and msvc 2013-64 for earlier releases.

Use Qt 5.6.0 for master branch and earlier, Qt 5.15.2 for seg-4d branch.

You can find more information from our cdash build system: https://github.com/pyushkevich/itksnap-cdash 

Best,
Jilei




강동하

unread,
Apr 6, 2021, 9:37:46 AM4/6/21
to itksna...@googlegroups.com
Thanks Jilei,

Let me get this straight.
What I understand is to use..
- ITK version 4.13.3
- VTK version 6.3.0
- QT version 5.6.0 
- msvc 2015-64bit
- itksnap version master

or 

- ITK version 4.13.3
- VTK version 6.3.0
- QT version 5.15.2
- msvc 2015-64bit
- itksnap version seg-4d

Correct ? 


Thanks a lot

Jilei Hao

unread,
Apr 6, 2021, 10:26:50 AM4/6/21
to itksna...@googlegroups.com
Mostly right, except followings:

itksnap master: use ITK 4.13.2, (shouldn't be much difference but 4.13.2 is what our system uses) 

For the seg-4d version, you probably want to build the seg4d-itk5 branch, which uses ITK 5.1.2.



강동하

unread,
Apr 6, 2021, 10:44:09 AM4/6/21
to itksna...@googlegroups.com
Thank you so much Jilei Hao,

I will try that as soon as possible and let you know if I have more issues

Dongha

Jilei Hao

unread,
Apr 6, 2021, 10:50:24 AM4/6/21
to itksnap-users
NP. It's great to have more developers trying to build and contribute to the software.

FYI, we also have a developer group/mail list. https://groups.google.com/g/itksnap-dev . Topics related to building and source code might receive more help from there.

Thanks,
Jilei

Dongha Kang

unread,
Apr 7, 2021, 6:22:04 AM4/7/21
to itksnap-users
First of all, sorry. It's me again.
I posted another problem in dev groups but It says it is pending...

I decided to use
- windows 10
- msvc 2015 64bit
- itk v 4.13.2
- vtk v 6.3.0
- itksnap master branch (for now)

I resolved all the issues except the one that I first mentioned, which is the libcurl / curl error.

1. I downloaded libcurl (I tried both from website and vcpkg) and made sure that it was working (curl --version works)
2. In CMake I gave a new entry name: CURL_LIBRARY; value: ..../lib/libcurl.lib (picture below) Also, I saw this conversation and tried to add CURL_INCLUDE_DIR. However, whenever I press configure button in CMake, it disappears like a magic.
3. I ran the solution and I got a bunch of LNK2019 error similar to this conversation (picture below)
4. when I don't add CURL_LIBRARY I get the error saying CURL_LIBARY_NOVALID.lib ... error

What can I do? I think this might be the last error that I need to fix. Waiting for your help!

Thanks
Dongha

cmake.png
curl error.png

Jilei Hao

unread,
Apr 7, 2021, 8:31:50 PM4/7/21
to itksna...@googlegroups.com
CURL_LIBRARY and CURL_INCLUDE_DIR are both needed.

CURL_LIBRARY is a file path variable, should point to libcurl.lib file, which I saw you did correctly.

CURL_INCLUDE_DIR should be a path variable, should point to the "include" directory of your curl build.

After successful configuration, these 2 variables should be in your CMakeCache.txt file in your binary folder. Something like:
CURL_LIBRARY:FILEPATH=F:/Playground/PICSL/curl/curl-build/curl_7.53.1/lib/libcurl.lib
CURL_INCLUDE_DIR:PATH=F:/Playground/PICSL/curl/curl-build/curl_7.53.1/include

I sometimes also got errors like variable value was override or just disappeared. You can try to empty your binary folder and let cmake regenerate everything.

Hope it helps.

Jilei



강동하

unread,
Apr 7, 2021, 9:07:44 PM4/7/21
to itksna...@googlegroups.com
This worked!

Even though CURL_INCLUDE_DIR variable disappears in Cmake ui, it still was in CMakeCache.txt 
Only thing I did extra was to put zlib1.dll in Windows/System folder and it worked perfectly

You've been a great teacher and helper for me and I really appreciate it.

Dongha,

Reply all
Reply to author
Forward
0 new messages