使用Gearman和MySQL使用自制软件编译错误

使用Gearman和MySQL使用自制软件编译错误,mysql,homebrew,gearman,Mysql,Homebrew,Gearman,尝试在Mac OSX上使用自制软件编译Gearman时,我遇到以下错误: 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 -Qunus

尝试在Mac OSX上使用自制软件编译Gearman时,我遇到以下错误:

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
brew安装gearman——使用mysql
libtool:compile:clang++-DHAVE_CONFIG_H-I.-fvisibility=hidden-I/usr/include-D_THREAD\u SAFE-DBUILDING_LIBGEARMAN-DHAVE_htonl-std=c++0x-g-O2-Wno未知pragmas-Qunused参数-Wall-Wextra-Wno属性-Wvarargs-Waddress-Warray边界-Wchar下标-Wcomment-Wcomment-Wctor dtor隐私-Wfloat equal-Wformat-2-Wformat-y2k-Wmissing字段初始值设定项-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-wunsed-Wunused-Wunused结果-Wunused变量-Wunused参数-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\u libgearman_server\u la-queue.o
libgearman服务器/plugins/queue/mysql/queue.cc:49:10:致命错误:“未找到mysql.h”文件
#包括
^
1生成错误

我使用的是MariaDB而不是MySQL,我怀疑这可能是原因。

作为一种快速简便的解决方法:

brew edit gearman
请看这一行:

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