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

MSVC CMake build failed on v1.5.6 #3999

Open
nono303 opened this issue Mar 28, 2024 · 0 comments · May be fixed by #4009
Open

MSVC CMake build failed on v1.5.6 #3999

nono303 opened this issue Mar 28, 2024 · 0 comments · May be fixed by #4009
Labels

Comments

@nono303
Copy link

nono303 commented Mar 28, 2024

Describe the bug
CMake build with ninja on MSVC 2022 (vs17) failed with error:
C:\sdk\src\zstd\build\VS2010\libzstd-dll\libzstd-dll.rc(4): fatal error C1083: Cannot open include file: 'zstd.h': No such file or directory

To Reproduce
Steps to reproduce the behavior:

  1. git checkout v1.5.6
  2. cmake -G "Ninja" -DCMAKE_INSTALL_PREFIX=C:\sdk\release\vs17_x64-avx2 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DZSTD_LEGACY_SUPPORT=ON -DZSTD_MULTITHREAD_SUPPORT=ON -DZSTD_BUILD_PROGRAMS=OFF -DZSTD_BUILD_CONTRIB=OFF -DZSTD_BUILD_TESTS=OFF -DZSTD_USE_STATIC_RUNTIME=OFF -DZSTD_PROGRAMS_LINK_SHARED=OFF -DZSTD_BUILD_STATIC=OFF -DZSTD_BUILD_SHARED=ON -DBUILD_SHARED_LIBS=ON C:\sdk\src\zstd\build\cmake
  3. ninja.exe -v install
  4. See error:
[26/39] Building RC object lib\CMakeFiles\libzstd_shared.dir\C_\sdk\src\zstd\build\VS2010\libzstd-dll\libzstd-dll.rc.res
FAILED: lib/CMakeFiles/libzstd_shared.dir/C_/sdk/src/zstd/build/VS2010/libzstd-dll/libzstd-dll.rc.res
C:/sdk/softs/cmake/bin/cmcldeps.exe RC C:\sdk\src\zstd\build\VS2010\libzstd-dll\libzstd-dll.rc lib\CMakeFiles\libzstd_shared.dir\C_\sdk\src\zstd\build\VS2010\libzstd-dll\libzstd-dll.rc.res.d lib\CMakeFiles\libzstd_shared.dir\C_\sdk\src\zstd\build\VS2010\libzstd-dll\libzstd-dll.rc.res "Note: including file: " "C:/sdk/softs/vs22/Community/VC/Tools/MSVC/14.40.33617/bin/Hostx64/x64/cl.exe" C:\WINDOW~1\10\bin\100226~1.0\x64\rc.exe -DXXH_NAMESPACE=ZSTD_ -DZSTD_DLL_EXPORT=1 -DZSTD_HEAPMODE=0 -DZSTD_LEGACY_SUPPORT=5 -DZSTD_MULTITHREAD -D_CONSOLE -D_CRT_SECURE_NO_WARNINGS -Dlibzstd_shared_EXPORTS -I C:\sdk\build\vs17_x64-avx2\zstd\lib -I C:\sdk\src\zstd\build\cmake\lib -DWIN32 -nologo -DZSTD_DISABLE_ASM /fo lib\CMakeFiles\libzstd_shared.dir\C_\sdk\src\zstd\build\VS2010\libzstd-dll\libzstd-dll.rc.res C:\sdk\src\zstd\build\VS2010\libzstd-dll\libzstd-dll.rc
C:\sdk\src\zstd\build\VS2010\libzstd-dll\libzstd-dll.rc(4): fatal error C1083: Cannot open include file: 'zstd.h': No such file or directory

Expected behavior
Build success

Desktop (please complete the following information):

  • OS: Windows
  • Version 11 23H2 22631.3374
  • Compiler MSVC 19.40.33617.1
  • Flags -DXXH_NAMESPACE=ZSTD_ -DZSTD_DLL_EXPORT=1 -DZSTD_HEAPMODE=0 -DZSTD_LEGACY_SUPPORT=5 -DZSTD_MULTITHREAD -D_CONSOLE -D_CRT_SECURE_NO_WARNINGS -Dlibzstd_shared_EXPORTS -IC:\sdk\build\vs17_x64-avx2\zstd\lib -IC:\sdk\src\zstd\build\cmake\lib /DWIN32 /D_WINDOWS /w /D_UNICODE /DUNICODE /MD /Zi /Gw /Gy /Zc:inline /O2 /Zf /Zi /FS /GL /MP16 /arch:AVX2 /w /DNDEBUG -DZSTD_DISABLE_ASM /showIncludes
  • Other relevant hardware specs AVX2
  • Build system CMake / ninja

Additional context
This patch fix the issue

diff --git a/build/VS2010/libzstd-dll/libzstd-dll.rc b/build/VS2010/libzstd-dll/libzstd-dll.rc
index 13e8746f..7099ddec 100644
--- a/build/VS2010/libzstd-dll/libzstd-dll.rc
+++ b/build/VS2010/libzstd-dll/libzstd-dll.rc
@@ -1,7 +1,7 @@
 // Microsoft Visual C++ generated resource script.
 //
 
-#include "zstd.h" /* ZSTD_VERSION_STRING */
+#include "../../../lib/zstd.h" /* ZSTD_VERSION_STRING */
 #define APSTUDIO_READONLY_SYMBOLS
 #include "verrsrc.h"
 #undef APSTUDIO_READONLY_SYMBOLS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants