Skip to content

MSVC: CMake err for determine type char ?? #193

@PlutusCN

Description

@PlutusCN

I try to install with the command "cmake .. -DCMAKE_BUILD_TYPE="buildtype" -DFOONATHAN_MEMORY_BUILD_EXAMPLES=OFF -DFOONATHAN_MEMORY_BUILD_TESTS=OFF -DFOONATHAN_MEMORY_BUILD_TOOLS=ON -DCMAKE_INSTALL_PREFIX=../install -DBUILD_SHARED_LIBS=ON" , but there occur an error, below is the record:

E:\Dev\study\open_source\DDS\foonathan_memory_msvc\build>cmake .. -DCMAKE_BUILD_TYPE="buildtype" -DFOONATHAN_MEMORY_BUILD_EXAMPLES=OFF -DFOONATHAN_MEMORY_BUILD_TESTS=OFF -DFOONATHAN_MEMORY_BUILD_TOOLS=ON -DCMAKE_INSTALL_PREFIX=../install -DBUILD_SHARED_LIBS=ON
-- Building for: Visual Studio 17 2022
-- Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.44.35211.0
-- The CXX compiler identification is MSVC 19.44.35211.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: D:/IDE/Microsoft/Visual_Studio/2022/Community/VC/Tools/MSVC/14.44.35207/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: D:/IDE/Microsoft/Visual_Studio/2022/Community/VC/Tools/MSVC/14.44.35207/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):
Unable to determine alignment of C++ type char - no error text matching
align_of<..., ##> in compiler output |Change Dir:
'E:/Dev/study/open_source/DDS/foonathan_memory_msvc/build/src/CMakeFiles/CMakeTmp'

Run Build Command(s):
D:/IDE/Microsoft/Visual_Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe
cmTC_c689b.vcxproj /p:Configuration=Debug /p:Platform=x64
/p:VisualStudioVersion=17.0 /v:n

閫傜敤浜?.NET Framework MSBuild 鐗堟湰 17.14.14+a129329f1

鐢熸垚鍚姩鏃堕棿涓?2025/7/7 22:19:49銆?

鑺傜偣 1
涓婄殑椤圭洰鈥淓:\Dev\study\open_source\DDS\foonathan_memory_msvc\build\src\CMakeFiles\CMakeTmp\cmTC_c689b.vcxproj鈥?榛樿鐩爣)銆?

PrepareForBuild:

姝e湪鍒涘缓鐩綍鈥渃mTC_c689b.dir\Debug\鈥濄€?
宸插惎鐢ㄧ粨鏋勫寲杈撳嚭銆傜紪璇戝櫒璇婃柇鐨勬牸寮忚缃皢鍙嶆槧閿欒灞傛缁撴瀯銆傛湁鍏宠缁嗕俊鎭紝璇峰弬闃?https://aka.ms/cpp/structured-output銆?
姝e湪鍒涘缓鐩綍鈥淓:\Dev\study\open_source\DDS\foonathan_memory_msvc\build\src\CMakeFiles\CMakeTmp\Debug\鈥濄€?
姝e湪鍒涘缓鐩綍鈥渃mTC_c689b.dir\Debug\cmTC_c689b.tlog\鈥濄€?

InitializeBuildStatus:

姝e湪鍒涘缓鈥渃mTC_c689b.dir\Debug\cmTC_c689b.tlog\unsuccessfulbuild鈥濓紝鍥犱负宸叉寚瀹氣€淎lwaysCreate鈥濄€?
姝e湪瀵光€渃mTC_c689b.dir\Debug\cmTC_c689b.tlog\unsuccessfulbuild鈥濇墽琛?Touch 浠诲姟銆?

ClCompile:

D:\IDE\Microsoft\Visual_Studio\2022\Community\VC\Tools\MSVC\14.44.35207\bin\HostX64\x64\CL.exe /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D _MBCS /D WIN32 /D _WINDOWS /D TEST_TYPE=char /D "CMAKE_INTDIR=\"Debug\"" /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cmTC_c689b.dir\Debug\\" /Fd"cmTC_c689b.dir\Debug\vc143.pdb" /external:W3 /Gd /TP /errorReport:queue E:\Dev\study\open_source\DDS\foonathan_memory_msvc\cmake\get_align_of.cpp
鐢ㄤ簬 x64 鐨?Microsoft (R) C/C++ 浼樺寲缂栬瘧鍣?19.44.35211 鐗?
鐗堟潈鎵€鏈?C) Microsoft Corporation銆備繚鐣欐墍鏈夋潈鍒┿€?
cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D _MBCS /D WIN32 /D _WINDOWS /D TEST_TYPE=char /D "CMAKE_INTDIR=\"Debug\"" /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cmTC_c689b.dir\Debug\\" /Fd"cmTC_c689b.dir\Debug\vc143.pdb" /external:W3 /Gd /TP /errorReport:queue E:\Dev\study\open_source\DDS\foonathan_memory_msvc\cmake\get_align_of.cpp
get_align_of.cpp

E:\Dev\study\open_source\DDS\foonathan_memory_msvc\cmake\get_align_of.cpp(6,27):
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'
[E:\Dev\study\open_source\DDS\foonathan_memory_msvc\build\src\CMakeFiles\CMakeTmp\cmTC_c689b.vcxproj]

    E:\Dev\study\open_source\DDS\foonathan_memory_msvc\cmake\get_align_of.cpp(6,27):
    妯℃澘瀹炰緥鍖栦笂涓嬫枃(鏈€鏃╃殑瀹炰緥鍖栦笂涓嬫枃)涓?
        E:\Dev\study\open_source\DDS\foonathan_memory_msvc\cmake\get_align_of.cpp(16,25):
        鏌ョ湅瀵规鍦ㄧ紪璇戠殑 绫?妯℃澘 瀹炰緥鍖栤€渁lign_of<char,1>鈥濈殑寮曠敤

宸插畬鎴愮敓鎴愰」鐩€淓:\Dev\study\open_source\DDS\foonathan_memory_msvc\build\src\CMakeFiles\CMakeTmp\cmTC_c689b.vcxproj鈥?榛樿鐩爣)鐨勬搷浣?-
澶辫触銆?

鐢熸垚澶辫触銆?

鈥淓:\Dev\study\open_source\DDS\foonathan_memory_msvc\build\src\CMakeFiles\CMakeTmp\cmTC_c689b.vcxproj鈥?榛樿鐩爣)
(1) ->

(ClCompile 鐩爣) ->

E:\Dev\study\open_source\DDS\foonathan_memory_msvc\cmake\get_align_of.cpp(6,27): 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' [E:\Dev\study\open_source\DDS\foonathan_memory_msvc\build\src\CMakeFiles\CMakeTmp\cmTC_c689b.vcxproj]



  0 涓鍛?
  1 涓敊璇?

宸茬敤鏃堕棿 00:00:00.32

|
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)

-- Configuring incomplete, errors occurred!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions