Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Msys2+MinGW64] The select function cannot be found. #283

Open
SineStriker opened this issue Dec 3, 2021 · 3 comments
Open

[Msys2+MinGW64] The select function cannot be found. #283

SineStriker opened this issue Dec 3, 2021 · 3 comments

Comments

@SineStriker
Copy link

I try to use msys and mingw-64 to run the configue process, which fails at

checking for std::unique_ptr<std::string>... yes
checking whether lstat correctly handles trailing slash... no
checking for modf... yes
checking for select... no
configure: error: The select function cannot be found.

It seems that a similar failure with realpath api has been reported and then fixed. But here comes the new problem.

@SineStriker SineStriker changed the title [Msys+MinGW64] The select function cannot be found. [Msys2+MinGW64] The select function cannot be found. Dec 3, 2021
@SamuelMarks
Copy link

@SineStriker Working on it - https://discourse.cmake.org/t/system-is-unknown-to-cmake-create-platform-mingw64-nt-10-0-19044/4734 - I think once it works with CMake (supported since 3.21 https://cmake.org/cmake/help/latest/release/3.21.html) then everything else will just work

@wessven
Copy link

wessven commented Oct 25, 2023

I'm getting the same error. My setup:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Neon
Description:    KDE neon 5.27
Release:        22.04
Codename:       jammy

$ cmake --version
cmake version 3.27.5

CMake suite maintained and supported by Kitware (kitware.com/cmake).

$ x86_64-w64-mingw32-gcc --version
x86_64-w64-mingw32-gcc (GCC) 10-win32 20220113
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@SamuelMarks
Copy link

@wessven New computer so trying to replicate on ba411e0:

$ pacman -S base-devel gcc git autotools gettext gettext-devel libtool automake doxygen cmake
$ autoreconf -fi
$ ./configure
$ make -j distcheck
# Errors about LaTeX not being installed
$ make -C fswatch
make[1]: *** No rule to make target '../../libfswatch/src/libfswatch.la', needed by 'fswatch.exe'.  Stop.
# 

After I did:

diff --git a/configure.ac b/configure.ac
index fd2ddc9..e92751b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -95,7 +95,9 @@ AM_CONDITIONAL([HAVE_MAKEINFO], [test -n "${MAKEINFO_PROG}"])

 # Initialize gettext.
 AM_GNU_GETTEXT([external])
-AM_GNU_GETTEXT_VERSION([0.19.4])
+AM_GNU_GETTEXT_VERSION([0.19.6])
+AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.6])
+
 AM_CONDITIONAL([USE_NLS], [test "x${USE_NLS}" = "xyes"])

 # Configure C++ compiler

PS: On the cmake side also in the MSYS2 MINGW64 terminal:

MINGW64 fswatch/build
$ cmake ..
$ cmake --build .
[ 87%] Built target libfswatch
[ 90%] Building CXX object fswatch/src/CMakeFiles/fswatch.dir/fswatch.cpp.o
/home/samue/repos/fswatch/fswatch/src/fswatch.cpp: In function ‘int main(int, char**)’:
/home/samue/repos/fswatch/fswatch/src/fswatch.cpp:868:27: error: ‘LOCALEDIR’ was not declared in this scope
  868 |   bindtextdomain(PACKAGE, LOCALEDIR);
      |                           ^~~~~~~~~
make[2]: *** [fswatch/src/CMakeFiles/fswatch.dir/build.make:76: fswatch/src/CMakeFiles/fswatch.dir/fswatch.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:215: fswatch/src/CMakeFiles/fswatch.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

Really wanted it to work, so just hacked in these two lines; for a PR use the proper target or include a header that already defines it:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fb82189..5c1c486 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -15,6 +15,8 @@
 #
 cmake_minimum_required(VERSION 3.8)
 project(fswatch VERSION 1.17.1 LANGUAGES C CXX)
+include(GNUInstallDirs)
+add_definitions(-DLOCALEDIR="${CMAKE_INSTALL_LOCALEDIR}")

 #@formatter:off
 set(PACKAGE           "${PROJECT_NAME}")

Which gives the nice:

[ 87%] Linking CXX static library libfswatch.a
[ 87%] Built target libfswatch
[ 90%] Building CXX object fswatch/src/CMakeFiles/fswatch.dir/fswatch.cpp.o
[ 93%] Linking CXX executable fswatch.exe
[ 93%] Built target fswatch
[ 96%] Building C object test/src/CMakeFiles/fswatch_test.dir/fswatch_test.c.o
[100%] Linking CXX executable fswatch_test.exe
[100%] Built target fswatch_test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants