Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: macOS Mojave "Can't link/include C library ' ', aborting"

267 views
Skip to first unread message

Daniël van Eeden

unread,
Jan 16, 2019, 1:45:03 AM1/16/19
to James Brown, dbi-...@perl.org
Can you share the output of mysql_config?

On 16 January 2019 07:27:39 James Brown via dbi-users <dbi-...@perl.org> wrote:

I have macOS Mojave and am not able to install DBD::mysql - can anyone help? 

Perl, mysql@5.7 and mysql-connector-c installed via Homebrew.

I get:

$ sudo /usr/local/bin/perl Makefile.PL
Password:


PLEASE NOTE:

For 'make test' to run properly, you must ensure that the
database user 'root' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.

mysql> grant all privileges on test.* to 'root'@'localhost' identified by 's3kr1t';

You can also optionally set the user to run 'make test' with:

perl Makefile.PL --testuser=username

I will use the following settings for compiling and testing:

  cflags        (mysql_config) = -I/usr/local/Cellar/mysql-connector-c/6.1.11/include
  embedded      (guessed     ) = 
  ldflags       (guessed     ) = 
  libs          (mysql_config) = -L/usr/local/Cellar/mysql-connector-c/6.1.11/lib -l
  mysql_config  (guessed     ) = mysql_config
  nocatchstderr (default     ) = 0
  nofoundrows   (default     ) = 0
  nossl         (default     ) = 0
  testdb        (default     ) = test
  testhost      (default     ) = 
  testpassword  (default     ) = 
  testport      (default     ) = 
  testsocket    (default     ) = 
  testuser      (guessed     ) = root

To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::mysql::INSTALL'.

Checking if libs are available for compiling...
Can't link/include C library '', aborting.

Any suggestions?

Thanks, James.

Daniël van Eeden

unread,
Jan 16, 2019, 2:00:03 AM1/16/19
to James Brown, dbi-...@perl.org
The --libs part of that looks wrong.
I would expect something like "... -lmysqlclient -lssl -lcrypto”, not a -l without library name.
Not sure why that might be.

On 16 January 2019 7:39:23 am James Brown via dbi-users <dbi-...@perl.org> wrote:

Sure:

$ /usr/local/bin/mysql_config
Usage: /usr/local/bin/mysql_config [OPTIONS]
Options:
        --cflags         [-I/usr/local/Cellar/mysql-connector-c/6.1.11/include ]
        --cxxflags       [-I/usr/local/Cellar/mysql-connector-c/6.1.11/include ]
        --include        [-I/usr/local/Cellar/mysql-connector-c/6.1.11/include]
        --libs           [-L/usr/local/Cellar/mysql-connector-c/6.1.11/lib -l ]
        --libs_r         [-L/usr/local/Cellar/mysql-connector-c/6.1.11/lib -l ]
        --plugindir      [/usr/local/Cellar/mysql-connector-c/6.1.11/lib/plugin]
        --socket         [/tmp/mysql.sock]
        --port           [0]
        --version        [6.1.11]
        --variable=VAR   VAR is one of:
                pkgincludedir [/usr/local/Cellar/mysql-connector-c/6.1.11/include]
                pkglibdir     [/usr/local/Cellar/mysql-connector-c/6.1.11/lib]
                plugindir     [/usr/local/Cellar/mysql-connector-c/6.1.11/lib/plugin]


Thanks,

James.

pa...@cpan.org

unread,
Jan 16, 2019, 3:45:03 AM1/16/19
to James Brown, dbi-...@perl.org
On Wednesday 16 January 2019 17:59:07 James Brown via dbi-users wrote:
> > On 16 Jan 2019, at 5:48 pm, Daniël van Eeden <Daniel.v...@myname.nl <mailto:Daniel.v...@myname.nl>> wrote:
> >
> > The --libs part of that looks wrong.
> > I would expect something like "... -lmysqlclient -lssl -lcrypto”, not a -l without library name.
> > Not sure why that might be.
>
> Thanks Daniël. To compile Dovecot to link against MySQL I had to use:
>
> export CPPFLAGS="-I/usr/local/opt/mysql@5.7/include/mysql -I/usr/local/Cellar/openssl@1.1/1.1.1/include"
> export LDFLAGS="-L/usr/local/opt/mysql@5.7/lib -L/usr/local/opt/openssl@1.1/lib"
>
> ./configure --with-mysql --with-ssl=openssl
>
> Would I have to do something like that?

Hi! After forking DBD::mysql to DBD::MariaDB, I fixed lot of problems
with parsing output of mysql_config and finding include paths and
libraries in Makefile.PL.

Makefile.PL in DBD::MariaDB accepts env variables DBD_MARIADB_CFLAGS
DBD_MARIADB_LIBS and override output from mysql_config when env variable
DBD_MARIADB_CONFIG is set to "skip".

Maybe something similar could work for DBD::mysql. But I do not know as
Makefile.PL in DBD::mysql had lot of bugs... Maybe it helps you.
0 new messages