Skip to content

On the Windows platform, msys2 compilation error occurs,error: 'readlink' was not declared in this s cope #440

@751643992

Description

@751643992

Windows (MinGW + Gtk)
Install MSYS2 toolchain and required libraries
MSYS2 is a software distro and building platform for Windows

Download MSYS2 from its official website and install it. Its installation guide is on the home page.

Open MSYS2 MinGW 64-bit or MSYS2 MinGW 32-bit from your start menu. Install tools and libraries:

pacman -S ${MINGW_PACKAGE_PREFIX}-toolchain
pacman -S ${MINGW_PACKAGE_PREFIX}-cairo
pacman -S ${MINGW_PACKAGE_PREFIX}-gtk3
pacman -S ${MINGW_PACKAGE_PREFIX}-libwebp
pacman -S make
Install CMake
pacman -S ${MINGW_PACKAGE_PREFIX}-cmake
Generating the Project using CMake
There are multiple ways to generate a project file using CMake depending on your platform and desired IDE, but here is an example for MSYS2:

Using UNIX makefiles
CD to the elements library.

Make a build directory inside the elements directory.

CD to the build directory.

invoke cmake. -DELEMENTS_HOST_UI_LIBRARY=gtk tells cmake to build with Gtk.

cd elements
mkdir build
cd build
cmake ../ -G "Unix Makefiles" -DELEMENTS_HOST_UI_LIBRARY=gtk

/elements/lib/host/gtk3/base_view.cpp:535:24: error: 'readlink' was not declared in this s
cope
535 | if (auto count = readlink("/proc/self/exe", result, PATH_MAX); count != -1)
| ^~~~~~~~
make[2]: *** [lib/CMakeFiles/elements.dir/build.make:815: lib/CMakeFiles/elements.dir/host/gtk3/base_view.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:838: lib/CMakeFiles/elements.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions