veracrypt / VeraCrypt

Disk encryption with strong security based on TrueCrypt
https://www.veracrypt.fr
Other
6.89k stars 947 forks source link

Сan't compile VeraCrypt #1398

Closed Alash07 closed 2 months ago

Alash07 commented 2 months ago

Hello everyone. I can't compile VeraCrypt on Visual Studio 2022 from the source code you provided here https://github.com/veracrypt/VeraCrypt. I did everything as per the instructions, I gave the paths to the specified folders. But there are many errors of this nature:

  1. Error C2079 "extensionPointDisablePolicy" uses an undefined structure struct "_PROCESS_MITIGATION_EXTENSION_POINT_DISABLE_POLICY" ExpandVolume C:\Vera\VeraCrypt-master\src\Common\Dlgcode.c 14479
  2. Error C2011 _PROCESS_MITIGATION_POLICY: redefinition of type "enum" Format C:\Vera\VeraCrypt-master\src\Common\Dlgcode.c 14448
  3. Error C2079 "aslrPolicy" uses an undefined structure struct "_PROCESS_MITIGATION_ASLR_POLICY" Format C:\Vera\VeraCrypt-master\src\Common\Dlgcode.c 14477 etc. maybe I didn't specify additional paths?
idrassi commented 2 months ago

Thank you for the report

The issue is caused by Windows 10 SDK headers conflicting with internal definitions. To fix this, we need to set minimun target version as Windows 8 for newer Visual Studui versions.

I have pushed the commit https://github.com/veracrypt/VeraCrypt/commit/c167799506f737b8d34133c824703291da797315 that fixes this issue\,

Feel free to reopen if the issue persists.

Alash07 commented 2 months ago

Hello friend, you know I'm still new to this demo, maybe I've already had problems with such questions, can you help me with the solution assembly error? 123 Maybe I missed something? I tried to compile and recompile on different configurations with platforms, but in the end I got this error? Or maybe I should have chosen the SLN project that is 2019? 1223 I use Windows 10 and MVS 22

idrassi commented 2 months ago

Yes, you should use 2019 sln when using VS2022. Also, you need to have "C++ ATL" component installed in Visual studio: run Visual Studio Install, click Modify and then go to "Individual Components" to select C++ ATL as shown below (screenshot is for VS2019 but it should be similar with VS2022):

image

Alash07 commented 2 months ago

I did everything as you said, but still get errors. I don't know what I did before, but it worked once, and now it doesn't work again and these are the errors. 1213 First I set the solution configuration to All, and the platform to Win32, the same errors come out, then I set x64 and click rebuild the solution. But still the same errors come out. Do you have a telegram channel? or telegram? Can you post a screen video of how you build this solution?

Alash07 commented 3 weeks ago

Hello dude! I finally built a solution! But when opening the .exe file, I got this error)) 1223 Безымянный Please help me what's the problem? The source files are all from your source By the way, I am not a developer or a coder, I am self-taught in programming

idrassi commented 3 weeks ago

This error is triggered because the code in release mode checks that executables are signed with official IDRIX code signing certificate.

There are two simple ways to solve this: