vapor-community / mysql-provider

MySQL provider for the Vapor web framework.
MIT License
30 stars 12 forks source link

error: 'mysql.h' file not found #31

Open MoridinBG opened 7 years ago

MoridinBG commented 7 years ago

This seems similar to #16, but installing mysql via Homebrew did not help

I run vapor new --template=api --branch=beta and then add

.Package(url: "https://github.com/vapor/mysql-provider", Version(2,0,0, prereleaseIdentifiers: ["beta"]))

to Package.swift

Then both Xcode and vapor build fail with the above message.

I managed to fix this by adding /usr/local/include/mysql to the MySQL target in Xcode. Then I got another message that lmysqlclient can not be found. This was fixed by adding libmysqlclient.dylib to Link Binary With Libraries Build Phase for MySQL and MySQLDriver and now everything builds and runs

I am using the latest version of the Toolbox on OS X 10.12.4 with MySQL 5.7.18 installed via homebrew.

MoridinBG commented 7 years ago

brew install cmysql solved this.

Running vapor build --verbose shows it multiple times:

note: you may be able to install cmysql using your system-packager:
brew install cmysql

Maybe this should be explicitly stated

tanner0101 commented 7 years ago

This should be added to the http://beta.docs.vapor.codes/mysql/package/ page. Thanks for reporting!

BrettRToomey commented 7 years ago

Nothing to see here 🕵️‍♀️