-
-
Notifications
You must be signed in to change notification settings - Fork 668
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
5.4 ITK Failed to build(CMake) with error LNK2005: __ucrt_int_to_float already defined #4820
Comments
Thank you for contributing an issue! 🙏 Welcome to the ITK community! 🤗👋☀️ We are glad you are here and appreciate your contribution. Please keep in mind our community participation guidelines. 📜 This is an automatic message. Allow for time for the ITK community to be able to read the issue and comment on it. |
So this also happens for VS2019 build with toolset v142. |
You can get the build to complete by adding "/FORCE:MULTIPLE" to the linker command line. TBD whether or not this causes issues in practice though. |
In Modules\ThirdParty\TIFF\src\itktiff\tif_config.h.in: /* MSVC does not support C99 inline, so just make the inline keyword That was apparently necessary for an older version of MSVC, but causes this problem for the version I have (Visual Studio 17.10.4, cl.exe version 19.40.33812). That define means __ucrt_int_to_float does not get inlined despite needing to be. That symbol ends up in three of the obj files (tif_aux.obj tif_color.obj tif_luv.obj) and I get a link warning when those three obj files are linked into itktiff-5.4.lib, but that link succeeds. Then when a later step tries to link into an exe (itkTestDriver) it chokes. I think those lines should just be removed, because it's not good to redefine a language keyword, and people should probably not be using such an old version of MSVC, and at least they should get a clear error message if they are. Another possible fix is to change the ifdef to something like: (But I had trouble confirming the version of MSVC that added inline keyword support for C.) |
@blowekamp @issakomi @seanm is anyone brave enough to update bundled version of TIFF? It seems like we have some very old version of it. |
@dzenanz I looked into it, and yes we do. It looks like there is CMake infrastructure in the new libtiff. It also looks like VTK is maintaining a forked repo version of libtiff. Seems like there should be more knowledge around what is needed to be done to update it than what I have. |
Extend the condition from commit 08bf6be (COMP: Conditionalize insane "#define inline" in libtiff, 2013-10-07, v4.5rc01~139^2). Newer MSVC versions need it to avoid duplicating `__ucrt_int_to_float`. Issue: InsightSoftwareConsortium#4820
closed by #4957 |
Extend the condition from commit 08bf6be (COMP: Conditionalize insane "#define inline" in libtiff, 2013-10-07, v4.5rc01~139^2). Newer MSVC versions need it to avoid duplicating `__ucrt_int_to_float`. Issue: InsightSoftwareConsortium#4820
Description
Fails to build on CMake 3.30.1
Windows SDK version 10.0.26100.0 to target Windows 10.0.22631.
[build] -- Using MSVC's dynamic CRT (/MD and /MDd)
With error message
Steps to Reproduce
Expected behavior
Build
Actual behavior
Reproducibility
100
Versions
v5.4.0
Environment
Fails to build on CMake 3.30.1
Windows SDK version 10.0.26100.0 to target Windows 10.0.22631.
[build] -- Using MSVC's dynamic CRT (/MD and /MDd)
MSVC 17.10 (VS2022)
Additional Information
The text was updated successfully, but these errors were encountered: