2015-12-17 2 views
0

Lors d'une tentative de compiler Gearman sur Mac OS X avec Homebrew, je reçois l'erreur suivante:Erreur de compilation avec Gearman et MySQL avec Homebrew

brew install gearman --with-mysql 

libtool: compile: clang++ -DHAVE_CONFIG_H -I. -fvisibility=hidden -I/usr/include -D_THREAD_SAFE -DBUILDING_LIBGEARMAN -DHAVE_HTONLL -std=c++0x -g -O2 -Wno-unknown-pragmas -Qunused-arguments -Wall -Wextra -Wno-attributes -Wvarargs -Waddress -Warray-bounds -Wchar-subscripts -Wcomment -Wctor-dtor-privacy -Wfloat-equal -Wformat=2 -Wformat-y2k -Wmissing-field-initializers -Wnon-virtual-dtor -Woverloaded-virtual -Wpointer-arith -Wredundant-decls -Wshadow -Wshorten-64-to-32 -Wsign-compare -Wstrict-overflow=1 -Wswitch-enum -Wundef -Wc++11-compat -Wunused -Wunused-result -Wunused-variable -Wunused-parameter -Wwrite-strings -Wformat-security -fwrapv -pipe -Wsizeof-pointer-memaccess -Wpacked -c libgearman-server/plugins/queue/mysql/queue.cc -fno-common -DPIC -o libgearman-server/plugins/queue/mysql/.libs/libgearman_server_libgearman_server_la-queue.o 
libgearman-server/plugins/queue/mysql/queue.cc:49:10: fatal error: 'mysql.h' file not found 
#include <mysql.h> 
     ^
1 error generated 

J'utilise MariaDB au lieu de MySQL - et je soupçonne que cela peut être le cause.

Répondre

0

Pour contourner ce problème rapide et facile:

brew edit gearman 

Rechercher cette ligne:

args << (build.with?("mysql") ? "--with-mysql=#{Formula["mysql"].opt_bin}/mysql_config" : "--without-mysql") 

Et changer Formula["mysql"] à Formula["mariadb"]

Run brew install gearman --with-mysql à nouveau et il compilera avec succès.