# Help wanted building 2.4.0 on VS2022

**URL:** <https://casparcgforum.org/t/help-wanted-building-2-4-0-on-vs2022/6576>\
**Category:** General\
**Tags:** development\
**Created:** [May 15, 2024, 11:33am UTC](https://casparcgforum.org/t/help-wanted-building-2-4-0-on-vs2022/6576 "2024-05-15T11:33:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![swtee2](https://casparcgforum.org/letter_avatar_proxy/v4/letter/s/71c47a/32.png) [@swtee2](https://casparcgforum.org/u/swtee2)\
**Post date:** [May 15, 2024, 11:33am UTC](https://casparcgforum.org/t/help-wanted-building-2-4-0-on-vs2022/6576/1 "2024-05-15T11:33:51Z")

</div>

Hi

I have trouble building 2.4.0 on Windows. It is regarding (at least) the cef-project. I have unsuccesfully been looking for answers to this. Likewise not been able to figure it out myself.

First I assume that the build.bat should be modified for

set BUILD\_VCVARSALL=C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat

and

cmake -G “Visual Studio 17 2022” -A x64 …\src || goto :error

for VS2022.

Please see the build error screen dump. Building in Visual Studio produce same result. Both Debug and Release.

 ![billede](https://casparcgforum.org/uploads/default/original/2X/e/eb5693cd94371a0462987a867f99ab4e51c3072f.png)

---

<div class="post-metadata">

**Author:** ![Julusian](https://casparcgforum.org/user_avatar/casparcgforum.org/julusian/32/12_2.png) [@Julusian](https://casparcgforum.org/u/Julusian)\
**Post date:** [May 15, 2024, 11:53am UTC](https://casparcgforum.org/t/help-wanted-building-2-4-0-on-vs2022/6576/2 "2024-05-15T11:53:58Z")

</div>

Have you made any other changes? I can’t explain why that patch wouldn’t apply if you are using the same build of cef as we are.

I have definitely used vs2022 during development without issue

---

<div class="post-metadata">

**Author:** ![swtee2](https://casparcgforum.org/letter_avatar_proxy/v4/letter/s/71c47a/32.png) [@swtee2](https://casparcgforum.org/u/swtee2)\
**Post date:** [May 15, 2024, 12:54pm UTC](https://casparcgforum.org/t/help-wanted-building-2-4-0-on-vs2022/6576/3 "2024-05-15T12:54:42Z")

</div>

I run everything as instructed with the build.bat modified as mentioned (is this correct, 17 2022). And then omit the package step.

Source is the 2.4.0 Stable tag.

I will try on a different machine later to see if that is any different.

---

<div class="post-metadata">

**Author:** ![Julusian](https://casparcgforum.org/user_avatar/casparcgforum.org/julusian/32/12_2.png) [@Julusian](https://casparcgforum.org/u/Julusian)\
**Post date:** [May 15, 2024, 1:17pm UTC](https://casparcgforum.org/t/help-wanted-building-2-4-0-on-vs2022/6576/4 "2024-05-15T13:17:38Z")

</div>

Hmm, very strange then…  
I’ve just made the master branch (which is 2.4.0 and a couple of tiny changes) build with 2022, and didn’t have any difficulty. You can see the full change I did at [chore: build with vs2022 · CasparCG/server@119297c · GitHub](https://github.com/CasparCG/server/commit/119297cdd39a5028914c4b90d41ed7f1654225e0)

---

<div class="post-metadata">

**Author:** ![swtee2](https://casparcgforum.org/letter_avatar_proxy/v4/letter/s/71c47a/32.png) [@swtee2](https://casparcgforum.org/u/swtee2)\
**Post date:** [May 15, 2024, 2:46pm UTC](https://casparcgforum.org/t/help-wanted-building-2-4-0-on-vs2022/6576/5 "2024-05-15T14:46:36Z")

</div>

Master-tip is same. Running on another machine is same. I have to look more into this. I will try a third that might be running VS2019.

---

<div class="post-metadata">

**Author:** ![Julusian](https://casparcgforum.org/user_avatar/casparcgforum.org/julusian/32/12_2.png) [@Julusian](https://casparcgforum.org/u/Julusian)\
**Post date:** [May 15, 2024, 3:06pm UTC](https://casparcgforum.org/t/help-wanted-building-2-4-0-on-vs2022/6576/6 "2024-05-15T15:06:25Z")

</div>

as a workaround you could comment out or delete the line [server/src/CMakeModules/Bootstrap\_Windows.cmake at master · CasparCG/server · GitHub](https://github.com/CasparCG/server/blob/master/src/CMakeModules/Bootstrap_Windows.cmake#L224)

Based on your screenshot it is complaining that the patch there doesnt apply to the version of cef being built, so it is failing. So maybe it will work fine without the patch?

---

<div class="post-metadata">

**Author:** ![swtee2](https://casparcgforum.org/letter_avatar_proxy/v4/letter/s/71c47a/32.png) [@swtee2](https://casparcgforum.org/u/swtee2)\
**Post date:** [May 16, 2024, 7:54am UTC](https://casparcgforum.org/t/help-wanted-building-2-4-0-on-vs2022/6576/7 "2024-05-16T07:54:08Z")

</div>

That modification builds using both msbuild and VS2022. Thanks.

Edit. Although VS do not build in debug if msbuild has not been run first. I think it is related to zlibstatic.lib being zlibstaticd.lib in debug. And VS fails this for some reason.

Edit2. Debug build in VS fails if

…\dist\zlib-prefix\src\zlib-build\Release\zlibstatic.lib

is missing. From the release-build.

You can cheat by coping the file (from a previous release-build).

I am picky, as the particular Win install used is short on disk space.

---

<div class="post-metadata">

**Author:** ![Julusian](https://casparcgforum.org/user_avatar/casparcgforum.org/julusian/32/12_2.png) [@Julusian](https://casparcgforum.org/u/Julusian)\
**Post date:** [May 20, 2024, 2:58pm UTC](https://casparcgforum.org/t/help-wanted-building-2-4-0-on-vs2022/6576/8 "2024-05-20T14:58:22Z")

</div>

> [@swtee2](#):
>
> Edit2. Debug build in VS fails if
> 
> …\dist\zlib-prefix\src\zlib-build\Release\zlibstatic.lib

Thats probably a case of [server/src/shell/CMakeLists.txt at 119297cdd39a5028914c4b90d41ed7f1654225e0 · CasparCG/server · GitHub](https://github.com/CasparCG/server/blob/119297cdd39a5028914c4b90d41ed7f1654225e0/src/shell/CMakeLists.txt#L62) needing to be split into a `debug` and `optimized` version like some of the others.  
A PR fixing that would be appreciated 🙂
