Almalinux install mysql5.6/8.0err

[ 25%] Building C object storage/heap/CMakeFiles/heap_embedded.dir/hp_write.c.o
[ 25%] Linking CXX static library libheap_embedded.a
[ 25%] Built target heap_embedded
[ 25%] Building CXX object storage/innobase/CMakeFiles/innobase_embedded.dir/api/api0api.cc.o
In file included from /www/server/mysql/src/storage/innobase/include/ha_prototypes.h:40,
from /www/server/mysql/src/storage/innobase/include/data0type.ic:38,
from /www/server/mysql/src/storage/innobase/include/data0type.h:549,
from /www/server/mysql/src/storage/innobase/include/data0data.h:40,
from /www/server/mysql/src/storage/innobase/include/que0que.h:38,
from /www/server/mysql/src/storage/innobase/include/api0misc.h:40,
from /www/server/mysql/src/storage/innobase/api/api0api.cc:46:
/www/server/mysql/src/include/my_compare.h:118:43: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
118 | extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
| ^~~~~~
/www/server/mysql/src/include/my_compare.h:118:67: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
118 | extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a,
| ^
/www/server/mysql/src/include/my_compare.h:119:39: warning: ISO C++17 does not allow ‘register’ storage class specifier [-Wregister]
119 | register uchar *b, uint key_length, uint nextflag,
| ^
In file included from /www/server/mysql/src/storage/innobase/api/api0api.cc:35:
/www/server/mysql/src/storage/innobase/include/univ.i:424:33: error: unnamed scoped enum is not allowed
424 | #define byte unsigned char
| ^~~~~~~~
/www/server/mysql/src/storage/innobase/include/univ.i:424:33: error: expected identifier before ‘unsigned’
In file included from /usr/include/c++/11/pstl/glue_algorithm_defs.h:13,
from /usr/include/c++/11/algorithm:74,
from /www/server/mysql/src/storage/innobase/include/dict0mem.h:59,
from /www/server/mysql/src/storage/innobase/include/dict0dict.h:41,
from /www/server/mysql/src/storage/innobase/include/rem0rec.ic:36,
from /www/server/mysql/src/storage/innobase/include/rem0rec.h:993,
from /www/server/mysql/src/storage/innobase/include/usr0sess.h:45,
from /www/server/mysql/src/storage/innobase/include/que0que.ic:34,
from /www/server/mysql/src/storage/innobase/include/que0que.h:535,
from /www/server/mysql/src/storage/innobase/include/api0misc.h:40,
from /www/server/mysql/src/storage/innobase/api/api0api.cc:46:
/usr/include/c++/11/functional:979:19: error: expected unqualified-id before ‘:’ token
979 | enum class byte : unsigned char;
| ^
make[2]: *** [storage/innobase/CMakeFiles/innobase_embedded.dir/build.make:76: storage/innobase/CMakeFiles/innobase_embedded.dir/api/api0api.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1922: storage/innobase/CMakeFiles/innobase_embedded.dir/all] Error 2
make: *** [Makefile:166: all] Error 2

========================================================
AlmaLinux release 9.0 (Emerald Puma)
Bit:64 Mem:1693M Core:1 gcc:11.2.1 cmake:3.20.2
Linux 5.14.0-70.22.1.el9_0.x86_64 x86_64
ERROR: mysql 5.6 installation failed.

other:mysql 5.7 ERROR not find libpcap

What are you building?

The GCC (version 11?) of EL9 does probably default to -std=gnu++17. Does your code conform with older C++ standard? If yes, then adjust the cmake config to use suitable language standard.

EL9 does have mysql 8.0, doesn’t it? If so, you should port your application to accept that, rather than try to get old mysql.

My program needs mysql 5.6,Understand?

But thank you for reminding me.

-- Performing Test HAVE_IB_LINUX_FUTEX
-- Performing Test HAVE_IB_LINUX_FUTEX - Success
-- Performing Test HAVE_CXX_W_cast_function_type
-- Performing Test HAVE_CXX_W_cast_function_type - Success
-- Performing Test HAVE_PEERCRED
-- Performing Test HAVE_PEERCRED - Success
-- Found PkgConfig: /bin/pkg-config (found version "1.7.3")
-- Checking for module 'libtirpc'
-- Package 'libtirpc', required by 'virtual:world', not found
CMake Warning at cmake/rpc.cmake:40 (MESSAGE):
Cannot find RPC development libraries. You need to install the required
packages:

Debian/Ubuntu: apt install libtirpc-dev
RedHat/Fedora/Oracle Linux: yum install libtirpc-devel
SuSE: zypper install glibc-devel

Call Stack (most recent call first):
cmake/rpc.cmake:87 (WARN_MISSING_SYSTEM_TIRPC)
plugin/group_replication/libmysqlgcs/cmake/configure.cmake:34 (MYSQL_CHECK_RPC)
plugin/group_replication/libmysqlgcs/CMakeLists.txt:34 (INCLUDE)


CMake Error at cmake/rpc.cmake:88 (MESSAGE):
Could not find rpc/rpc.h in /usr/include or /usr/include/tirpc
Call Stack (most recent call first):
plugin/group_replication/libmysqlgcs/cmake/configure.cmake:34 (MYSQL_CHECK_RPC)
plugin/group_replication/libmysqlgcs/CMakeLists.txt:34 (INCLUDE)


-- Configuring incomplete, errors occurred!
See also "/www/server/mysql/src/install/CMakeFiles/CMakeOutput.log".
See also "/www/server/mysql/src/install/CMakeFiles/CMakeError.log".
make: *** No targets specified and no makefile found. Stop.

========================================================
AlmaLinux release 9.0 (Emerald Puma)
Bit:64 Mem:1693M Core:4 gcc:11.2.1 cmake:3.20.2
Linux 5.14.0-70.26.1.el9_0.x86_64 x86_64
ERROR: mysql 8.0 installation failed.
AlmaLinux 9 - CRB                                                                                                                                       5.1 MB/s | 2.5 MB     00:00    
Package libpcap-devel-14:1.10.0-4.el9.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

Add this parameter “-DCMAKE_CXX_STANDARD=11” when using CMake.