Skip to content
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

Install fail on windows because of some cmake errors #72

Open
liebebaby opened this issue Jul 2, 2024 · 7 comments
Open

Install fail on windows because of some cmake errors #72

liebebaby opened this issue Jul 2, 2024 · 7 comments

Comments

@liebebaby
Copy link

I try to install foonathan_memory_vendor on windows11 and I got the following error:
屏幕截图 2024-07-02 163913
屏幕截图 2024-07-02 164058
屏幕截图 2024-07-02 164119

It seems like some cmake errors occurred. I tried master branch and also tried for-windows-installers branch, and got the same error. Anyone can help me?

@liebebaby
Copy link
Author

I use Visual Studio 2022, should I change it to Visual Studio 2019? But that's too inconvenient for me. I think Visual Studio is forward compatible,so I think what is done by VS 2019 can always be done by VS 2022.

@MiguelCompany
Copy link
Member

The issue here is that your compiler's output does not match with what the CMake expects.

As you can see here, the CMake script is searching for align_of<type,N> in the compiler output. In your screenshot, the first two letters have been replaced with another character

@liebebaby
Copy link
Author

The issue here is that your compiler's output does not match with what the CMake expects.

As you can see here, the CMake script is searching for align_of<type,N> in the compiler output. In your screenshot, the first two letters have been replaced with another character

Thank you,now I understand that it's because "align_of_matched" is false.
image
But it's still hard for me to understand why it is false. It seems that my compiler is not compatible right? should I change to VS 2019? what do you mean by "the first two letters have been replaced with another character"?

@MiguelCompany
Copy link
Member

what do you mean by "the first two letters have been replaced with another character"?

I mean this:
image

Is it possible for you to tell the compiler to report errors in English?

The compiler output in that case would be something like:

<source>(10): error C2338: static_assert failed: 'this should fail, the purpose of this is to generate a compile error on this type that contains the alignment value on this target'
<source>(10): note: the template instantiation context (the oldest one first) is
<source>(20): note: see reference to class template instantiation 'align_of<char,1>' being compiled

@liebebaby
Copy link
Author

what do you mean by "the first two letters have been replaced with another character"?

I mean this: image

Is it possible for you to tell the compiler to report errors in English?

The compiler output in that case would be something like:

<source>(10): error C2338: static_assert failed: 'this should fail, the purpose of this is to generate a compile error on this type that contains the alignment value on this target'
<source>(10): note: the template instantiation context (the oldest one first) is
<source>(20): note: see reference to class template instantiation 'align_of<char,1>' being compiled

Thank you, now I understand that it's because the compiler report errors in Chinese. But I don't know how to tell the compiler reports errors in English. I download Visual Studio Community 2022, and the compiler is MSVC 19.40.33811.0, and the default interface is Chinese as below:
image

@DayBeha
Copy link

DayBeha commented Jul 23, 2024

same error:

PS C:\Softwares\DDS\FastDDS\foonathan_memory_vendor\build> cmake --build . --target install --config release
MSBuild version 17.10.4+10fbfbf2e for .NET Framework

  Checking Build System
  Creating directories for 'foo_mem-ext'
  Building Custom Rule C:/Softwares/DDS/FastDDS/foonathan_memory_vendor/CMakeLists.txt
  Performing download step (git clone) for 'foo_mem-ext'
  Cloning into 'foo_mem-ext'...
  HEAD is now at 0f07757 Release 0.7-3
  No update step for 'foo_mem-ext'
  No patch step for 'foo_mem-ext'
  Performing configure step for 'foo_mem-ext'
  -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
  -- The C compiler identification is MSVC 19.40.33811.0
  -- The CXX compiler identification is MSVC 19.40.33811.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.40.33807/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.40.33807/bin/Hostx64/x64/
  cl.exe - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Performing Test HAVE_CXX_ATOMIC_NOFLAG
  -- Performing Test HAVE_CXX_ATOMIC_NOFLAG - Success
  -- Getting container node sizes
  CMake Error at cmake/get_container_node_sizes.cmake:39 (message):
  -- Configuring incomplete, errors occurred!
  See also "C:/Softwares/DDS/FastDDS/foonathan_memory_vendor/build/foo_mem-ext-prefix/src/foo_mem-ext-build/CMakeFiles/CMakeOutput.log"
  .
    Unable to determine alignment of C++ type char - no error text matching
    align_of<..., ##> in compiler output |Change Dir:
    C:/Softwares/DDS/FastDDS/foonathan_memory_vendor/build/foo_mem-ext-prefix/src/foo_mem-ext-build/src/CMakeFiles/CMakeTmp




    Run Build Command(s):C:/Program Files/Microsoft Visual
    Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe
    cmTC_24881.vcxproj /p:Configuration=Debug /p:Platform=x64
    /p:VisualStudioVersion=17.0 /v:m && MSBuild version 17.10.4+10fbfbf2e for
    .NET Framework



      Microsoft (R) C/C++ Optimizing Compiler Version 19.40.33811 for x64
      Copyright (C) Microsoft Corporation.  All rights reserved.
      cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D _MBCS /D WIN32 /D _WINDOWS /D TEST_TYPE=char /D "CMAKE_INTDIR=\"Debug\"" /Gm-
  /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cmTC_24881.dir\Debug\\" /Fd"cmTC_24881.dir\Debug\vc143.p
  db" /external:W3 /Gd /TP /errorReport:queue "C:\Softwares\DDS\FastDDS\foonathan_memory_vendor\build\foo_mem-ext-prefix\src\foo_mem-ex
  t\cmake\get_align_of.cpp"
      get_align_of.cpp


    C:\Softwares\DDS\FastDDS\foonathan_memory_vendor\build\foo_mem-ext-prefix\src\foo_mem-ext\cmake\get_align_of.cpp(6,27):
CUSTOMBUILD : error C2338: static_assert failed: 'this should fail, the purpose of this [C:\Softwares\DDS\FastDDS\foonathan_memory_vend
or\build\foo_mem-ext.vcxproj]
    is to generate a compile error on this type that contains the alignment
    value on this target'
    [C:\Softwares\DDS\FastDDS\foonathan_memory_vendor\build\foo_mem-ext-prefix\src\foo_mem-ext-build\src\CMakeFiles\CMakeTmp\cmTC_24881
  .vcxproj]




    |
  Call Stack (most recent call first):
    cmake/get_container_node_sizes.cmake:57 (get_alignof_type)
    cmake/get_container_node_sizes.cmake:137 (unique_aligned_types)
    src/CMakeLists.txt:80 (get_container_node_sizes)


C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: Cu
stom build for 'C:\Softwares\DDS\FastDDS\foonathan_memory_vendor\build\CMakeFiles\e94e2ad8b69a328aadfc757f33873e9d\foo_mem-ext-mkdir.ru
le;C:\Softwares\DDS\FastDDS\foonathan_memory_vendor\build\CMakeFiles\e94e2ad8b69a328aadfc757f33873e9d\foo_mem-ext-download.rule;C:\Soft
wares\DDS\FastDDS\foonathan_memory_vendor\build\CMakeFiles\e94e2ad8b69a328aadfc757f33873e9d\foo_mem-ext-update.rule;C:\Softwares\DDS\Fa
stDDS\foonathan_memory_vendor\build\CMakeFiles\e94e2ad8b69a328aadfc757f33873e9d\foo_mem-ext-patch.rule;C:\Softwares\DDS\FastDDS\foonath
an_memory_vendor\build\CMakeFiles\e94e2ad8b69a328aadfc757f33873e9d\foo_mem-ext-configure.rule;C:\Softwares\DDS\FastDDS\foonathan_memory
_vendor\build\CMakeFiles\e94e2ad8b69a328aadfc757f33873e9d\foo_mem-ext-build.rule;C:\Softwares\DDS\FastDDS\foonathan_memory_vendor\build
\CMakeFiles\e94e2ad8b69a328aadfc757f33873e9d\foo_mem-ext-install.rule;C:\Softwares\DDS\FastDDS\foonathan_memory_vendor\build\CMakeFiles
\2a1f702a5346bd5207fc534963c02fba\foo_mem-ext-complete.rule;C:\Softwares\DDS\FastDDS\foonathan_memory_vendor\build\CMakeFiles\f8c2e523a
a45af915a11bfe514d5e105\foo_mem-ext.rule;C:\Softwares\DDS\FastDDS\foonathan_memory_vendor\CMakeLists.txt' exited with code 1. [C:\Softw
ares\DDS\FastDDS\foonathan_memory_vendor\build\foo_mem-ext.vcxproj]

@JesusPoderoso
Copy link
Contributor

Hi @DayBeha,
try to downgrade the CMake version to 3.20 or 3.22 (up to 3.27). Greater versions also change the compiler output.
VS 2022 is not currently supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants