vlang / v

Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io
MIT License
35.69k stars 2.15k forks source link

mysql.h not found on RHEL 9 #14952

Open Jeffrey-de-Bruijn opened 2 years ago

Jeffrey-de-Bruijn commented 2 years ago

V version: 0.3.0 ec75860 OS: RHEL 9

What did you do? Downloaded V linux binary, attempted to test standard mysql library following the documentation

import mysql

// Create connection
mut connection := mysql.Connection{
    username: 'mysqlusr'
    dbname: 'mysqldb'
}
// Connect to server
connection.connect()?

This gives

builder error: 'mysql.h' not found

Package mysql-devel in installed and mysql.h is present

ls -lah /usr/include/mysql/mysql.h 
-rw-r--r--. 1 root root 33K Jul  1  2021 /usr/include/mysql/mysql.h

What did you expect to see? No errors

What did you see instead? Error

UPDATE: same error happens on Circle Linux 8.6

spytheman commented 2 years ago

From /usr/lib64/pkgconfig/mysqlclient.pc

prefix=/usr
includedir=${prefix}/include/mysql
libdir=${prefix}/lib64/mysql

Name: mysqlclient
Description: MySQL client library
Version: 21.1.26
Cflags: -I${includedir} -m64 
Libs: -L${libdir} -lmysqlclient
Libs.private:  -lpthread -ldl -lz -lresolv -lm -lrt
Requires.private: openssl

... which later V parses, but produces: -I "/usr/include/mysql -m64" ... instead of just: -I /usr/include/mysql -m64 -> the compilation failure.

einar-hjortdal commented 1 year ago

I ran into this problem today

itsalongstory commented 1 year ago

Try sudo dnf install mariadb-connector-c-devel.x86_64

einar-hjortdal commented 1 year ago

Try sudo dnf install mariadb-connector-c-devel.x86_64

The package conflicts with mysql-devel.

This problem was already confirmed, but not fixed yet