Menu

Veracrypt fails to build from source

Kev
2024-09-18
2024-09-18
  • Kev

    Kev - 2024-09-18

    Hi
    I'm unable to build the latest git on Linux, it errors with the following

    Linking veracrypt
    ./src/common/cmdline.cpp(523): assert ""Assert failure"" failed in FindOptionByAnyName(): Unknown option allow-screencapture

    (process:2406548): Gtk-CRITICAL : 08:08:04.340: _gtk_css_lookup_resolve: assertion '(((extension ({ GTypeInstance __inst = (GTypeInstance) ((provider)); GType __t = ((_gtk_style_provider_private_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))' failed

    (process:2406548): GLib-GObject-CRITICAL **: 08:08:04.340: g_object_set_data_full: assertion 'G_IS_OBJECT (object)' failed

    (process:2406548): Gtk-ERROR **: 08:08:04.340: Can't create a GtkStyleContext without a display connection
    Trace/breakpoint trap
    make[1]: *** [Main.make:201: veracrypt] Error 1
    make: *** [Makefile:578: all] Error 2

     
  • Mounir IDRASSI

    Mounir IDRASSI - 2024-09-18

    @bkev: It looks like the error you're encountering is referencing a file that doesn't exist in the VeraCrypt codebase. Specifically there is no ./src/common/cmdline.cpp file and the actual ./src/Common/CmdLine.c file is only 184 lines long.

    Additionally, the function FindOptionByAnyName() mentioned in the error does not exist in the VeraCrypt source code. This suggests that the code you're working with might be a modified version of VeraCrypt, not the original.

    I have previously set up an automatic build action on GitHub and it completed without any issues for the latest commit: https://github.com/veracrypt/VeraCrypt/actions/runs/10907155195/job/30270124452.

    Lastly, the allow-screencapture option is only defined in src/Main/CommandLineInterface.cpp for macOS so it's not possible for this to trigger an error on Linux.

    It may be worth verifying the source code you're using or checking for any local modifications.

     
  • Kev

    Kev - 2024-09-18

    Thanks for the fast reply.

    I don't mess with the code, I don't know anything about it.

    But, I have just tried this

    git clone https://github.com/veracrypt/VeraCrypt.git

    cd to the src folder
    ./src/Build/build_cmake_deb.sh INDICATOR
    This has worked in the past but is failing now and I've got the same error again.

    I was able to build Veracrypt last time I tried on 11 Sept successfully using the same method.

    I'm happy to try a different way but I'm a little stumped I'm afraid.

     
  • Mounir IDRASSI

    Mounir IDRASSI - 2024-09-18

    @bkev: Now I understand what is happening. The file ./src/common/cmdline.cpp is from wxWidgets and it is complaining about a missing switch. The FindOptionByAnyName function is part of the wxWidgets code.

    The GitHub build action uses a static build of wxWidgets from the 3.2.5 source and this assert is not triggered there. However, the assert is triggered when building against the version of wxWidgets included with Ubuntu.

    There was indeed a section of the code that queried for the --allow-screencapture switch on Linux which caused the assert. I have pushed a commit to fix this: https://sourceforge.net/p/veracrypt/code/ci/19943461f7afc9260e6bc32d48fbf94cd4a8a01e/

    Thank you for reporting this issue.

    PS: The GitHub build action uses a static build of wxWidgets because, on Ubuntu 24.04, there is a bug in the included version of wxWidgets. This bug was fixed in wxWidgets 3.2.5 but it is not part of the Ubuntu release. The bug causes VeraCrypt to crash if run with the --text switch.

     
  • Kev

    Kev - 2024-09-18

    @idrassi Thanks for fixing and understanding what was going on!

    Yes, I have xmWidgets extracted to a folder and at the start of the build it detects it

    Using existing PARENTDIR: /path/, wxBuildConsole is present.
    

    I've tried my usual method and it has indeed fixed it, thanks again.

    I did try with wxWidgets 2.6 for info, but I get this

    Error: Neither wxBuildConsole nor wxWidgets-3.2.5 found in /tmp. Exiting.
    

    One other thing, it hasn't caused an issue at the moment, but is this something related to my machine?

    CMake Deprecation Warning at CMakeLists.txt:2 (cmake_minimum_required):
      Compatibility with CMake < 2.8.12 will be removed from a future version of
      CMake.
    
     

Log in to post a comment.

MongoDB Logo MongoDB