# Windows build error penfhe

**URL:** <https://openfhe.discourse.group/t/windows-build-error-penfhe/1469>\
**Category:** Library Questions\
**Created:** [August 2, 2024, 8:37pm UTC](https://openfhe.discourse.group/t/windows-build-error-penfhe/1469 "2024-08-02T20:37:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![techman](https://avatars.discourse-cdn.com/v4/letter/t/90db22/32.png) [@techman](https://openfhe.discourse.group/u/techman)\
**Post date:** [August 2, 2024, 8:37pm UTC](https://openfhe.discourse.group/t/windows-build-error-penfhe/1469/1 "2024-08-02T20:37:00Z")

</div>

I am seeking assistance with an error I encountered while building OpenFHE on a Windows system using MinGW64. Below are the details of my setup and the error message.

I followed the instructions here:

> [Installing OpenFHE on Windows — OpenFHE documentation](https://openfhe-development.readthedocs.io/en/latest/sphinx_rsts/intro/installation/windows.html)

Steps I followed:

1. download MSYS2
2. start MSYS2 MINGW64
3. pacman –Syu
4. pacman –S mingw-w64-x86\_64-gcc
5. pacman –S mingw-w64-x86\_64-cmake
6. pacman –S make
7. pcaman –S git
8. git clone [GitHub - openfheorg/openfhe-development: This is the development repository for the OpenFHE library. The current (stable) version is v1.2.0 (released on June 25, 2024).](https://github.com/openfheorg/openfhe-development.git)
9. cd openfhe-development
10. mkdir build
11. cd build
12. cmake … (something reports ‘failed’)
13. pacman -S autoconf
14. make –j

**Error Message:** While running the `make` command, I encountered the following error:

In file included from C:/msys64/mingw64/include/c++/14.1.0/bits/stl\_uninitialized.h:63,  
from C:/msys64/mingw64/include/c++/14.1.0/memory:69,  
from C:/msys64/home/TechSavyy/openfhe-development/src/pke/include/encoding/coefpackedencoding.h:40,  
from C:/msys64/home/TechSavyy/openfhe-development/src/pke/lib/encoding/coefpackedencoding.cpp:36:  
In static member function ‘static \_Up\* std::\_\_copy\_move\<\_IsMove, true, std::random\_access\_iterator\_tag\>::\_\_copy\_m(\_Tp\*, \_Tp\*, \_Up\*) [with \_Tp = long long unsigned int; \_Up = long long unsigned int; bool \_IsMove = false]’,  
inlined from ‘\_OI std::\_\_copy\_move\_a2(\_II, \_II, \_OI) [with bool \_IsMove = false; \_II = long long unsigned int\*; \_OI = long long unsigned int\*]’ at C:/msys64/mingw64/include/c++/14.1.0/bits/stl\_algobase.h:521:30,  
inlined from ‘\_OI std::\_\_copy\_move\_a1(\_II, \_II, \_OI) [with bool \_IsMove = false; \_II = long long unsigned int\*; \_OI = long long unsigned int\*]’ at C:/msys64/mingw64/include/c++/14.1.0/bits/stl\_algobase.h:548:42,  
inlined from ‘\_OI std::\_\_copy\_move\_a(\_II, \_II, \_OI) [with bool \_IsMove = false; \_II = long long unsigned int\*; \_OI = long long unsigned int\*]’ at C:/msys64/mingw64/include/c++/14.1.0/bits/stl\_algobase.h:555:31,  
inlined from ‘std::copy(\_II, \_II, \_OI) [with \_II = long long unsigned int\*; \_OI = long long unsigned int\*]’ at C:/msys64/mingw64/include/c++/14.1.0/bits/stl\_algobase.h:651:7,  
inlined from ‘static \_ForwardIterator std::\_\_uninitialized\_copy::\_\_uninit\_copy(\_InputIterator, \_InputIterator, \_ForwardIterator) [with \_InputIterator = long long unsigned int\*; \_ForwardIterator = long long unsigned int\*]’ at C:/msys64/mingw64/include/c++/14.1.0/bits/stl\_uninitialized.h:147:27,  
inlined from ‘std::uninitialized\_copy(\_InputIterator, \_InputIterator, \_ForwardIterator) [with \_InputIterator = long long unsigned int\*; \_ForwardIterator = long long unsigned int\*]’ at C:/msys64/mingw64/include/c++/14.1.0/bits/stl\_uninitialized.h:185:15,  
inlined from ‘std::\_\_uninitialized\_copy\_a(\_InputIterator, \_InputIterator, \_ForwardIterator, allocator\<\_Tp\>&) [with \_InputIterator = long long unsigned int\*; \_ForwardIterator = long long unsigned int\*; \_Tp = long long unsigned int]’ at C:/msys64/mingw64/include/c++/14.1.0/bits/stl\_uninitialized.h:373:37,  
inlined from ‘std::vector\<\_Tp, \_Alloc\>& std::vector\<\_Tp, \_Alloc\>::operator=(const std::vector\<\_Tp, \_Alloc\>&) [with \_Tp = long long unsigned int; \_Alloc = std::allocator]’ at C:/msys64/mingw64/include/c++/14.1.0/bits/vector.tcc:257:35,  
inlined from ‘bigintdyn::ubint\<limb\_t\>& bigintdyn::ubint\<limb\_t\>::operator=(const bigintdyn::ubint\<limb\_t\>&) [with limb\_t = long long unsigned int]’ at C:/msys64/home/TechSavyy/openfhe-development/src/core/include/math/hal/bigintdyn/ubintdyn.h:230:17,  
inlined from ‘void lbcrypto::encodeVec(P&, const PlaintextModulus&, int64\_t, int64\_t, const std::vector&, SCHEME) [with P = PolyImpl\<bigintdyn::mubintvec\<bigintdyn::ubint \> \>]’ at C:/msys64/home/TechSavyy/openfhe-development/src/pke/lib/encoding/coefpackedencoding.cpp:67:17,  
inlined from ‘virtual bool lbcrypto::CoefPackedEncoding::Encode()’ at C:/msys64/home/TechSavyy/openfhe-development/src/pke/lib/encoding/coefpackedencoding.cpp:85:18:  
C:/msys64/mingw64/include/c++/14.1.0/bits/stl\_algobase.h:452:30: error: ‘void\* \_\_builtin\_memmove(void\*, const void\*, long long unsigned int)’ forming offset 8 is out of the bounds [0, 8] [-Werror=array-bounds=]  
452 | \_\_builtin\_memmove(\_\_result, \_\_first, sizeof(\_Tp) \* \_Num);  
| ~~~^~~~~~~~~~~~~~~~~~~~~~~~~  
cc1plus.exe: all warnings being treated as errors  
make[2]: \*\*\* [src/pke/CMakeFiles/pkeobj.dir/build.make:167: src/pke/CMakeFiles/pkeobj.dir/lib/encoding/coefpackedencoding.cpp.obj] Error 1  
make[1]: \*\*\* [CMakeFiles/Makefile2:841: src/pke/CMakeFiles/pkeobj.dir/all] Error 2  
make: \*\*\* [Makefile:136: all] Error 2

Could anyone provide guidance on how to resolve this error? Any help or pointers would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![dsuponitskiy-duality](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@dsuponitskiy-duality](https://openfhe.discourse.group/u/dsuponitskiy-duality)\
**Post date:** [August 4, 2024, 4:59pm UTC](https://openfhe.discourse.group/t/windows-build-error-penfhe/1469/2 "2024-08-04T16:59:37Z")

</div>

@techman You can link OpenFHE v1.2 with g+±12 or any earlier version. We will address all g+±14 errors in the next release. Meanwhile, you can obtain older versions of MSYS2 [here](https://github.com/msys2/msys2-installer/releases).

---

<div class="post-metadata">

**Author:** ![techman](https://avatars.discourse-cdn.com/v4/letter/t/90db22/32.png) [@techman](https://openfhe.discourse.group/u/techman)\
**Post date:** [August 4, 2024, 5:17pm UTC](https://openfhe.discourse.group/t/windows-build-error-penfhe/1469/3 "2024-08-04T17:17:19Z")

</div>

Hi Guys,  
I have resolved the issue. I would like to add that obtaining old older versions of MSYS2 would not resolve the issue if you execute the command pacman -Syu. In my case it reverts back to g++14. So, you should ignore that command to resolve the issue.

---

<div class="post-metadata">

**Author:** ![indiraschka](https://avatars.discourse-cdn.com/v4/letter/i/4491bb/32.png) [@indiraschka](https://openfhe.discourse.group/u/indiraschka)\
**Post date:** [August 21, 2024, 7:16pm UTC](https://openfhe.discourse.group/t/windows-build-error-penfhe/1469/4 "2024-08-21T19:16:56Z")

</div>

hey, could you elaborate on what the solution is, I might have the same issue

---

<div class="post-metadata">

**Author:** ![audobong](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@audobong](https://openfhe.discourse.group/u/audobong)\
**Post date:** [September 6, 2024, 9:02am UTC](https://openfhe.discourse.group/t/windows-build-error-penfhe/1469/5 "2024-09-06T09:02:38Z")

</div>

See how this was solved here

> [@OpenFHE build error at 22%](https://openfhe.discourse.group/t/openfhe-build-error-at-22/1504):
>
> Hello! I’m looking for help regarding a build error. I repeatedly ran into this error when building OpenFHE on windows system using MinGW64. I followed each step of the documentation for installation. Starting when running cmake, there are a few problems from Performing Test HAVE\_CXX\_FLAG\_WSHORTEN\_64\_TO\_32, HAVE\_CXX\_FLAG\_WD654, HAVE\_CXX\_FLAG\_WITHREAD\_SAFETY, HAVE\_GNU\_POSIX\_REGEX, HAVE\_POSIX\_REGEX these failed Assuming they’re not critical I continued; After invoking make, the build stopped a…

---

<div class="post-metadata">

**Author:** ![techman](https://avatars.discourse-cdn.com/v4/letter/t/90db22/32.png) [@techman](https://openfhe.discourse.group/u/techman)\
**Post date:** [September 9, 2024, 10:02am UTC](https://openfhe.discourse.group/t/windows-build-error-penfhe/1469/6 "2024-09-09T10:02:19Z")

</div>

Get an old version: I used this: msys2-x86\_64-20230318.exe

and then follow these steps:  
I followed the instructions here:

> [Installing OpenFHE on Windows — OpenFHE documentation](https://openfhe-development.readthedocs.io/en/latest/sphinx_rsts/intro/installation/windows.html)

Steps I followed:

1. Install an old version of MSYS2
2. Admin run MSYS2 MINGW64
3. …
4. pacman –S mingw-w64-x86\_64-gcc
5. pacman –S mingw-w64-x86\_64-cmake
6. pacman –S make
7. pcaman –S git
8. git clone [GitHub - openfheorg/openfhe-development: This is the development repository for the OpenFHE library. The current (stable) version is v1.2.0 (released on June 25, 2024).](https://github.com/openfheorg/openfhe-development.git)
9. cd openfhe-development
10. mkdir build
11. cd build
12. cmake …
13. pacman -S autoconf
14. make –j
