vapor-community / postgresql

Robust PostgreSQL interface for Swift
MIT License
131 stars 33 forks source link

'libpq-fe.h' file not found when compiling via Xcode #52

Closed joshpc closed 7 years ago

joshpc commented 7 years ago

I'm not sure if this belongs here or on the main Vapor project, but hopefully someone can direct me.

Problem

When including the postgresql package with vapor, the project will not compile with the generated Xcode project.

How to Reproduce

  1. Create a blank Vapor project
  2. Add the the vapor-community/postgresql package
  3. Generate an xcode project using vapor xcode
  4. Attempt to build inside of Xcode

Notes

vapor build works fine, so it seems like it's an Xcode project generation issue (missing a framework/header search path).

However, I'm only just getting into Vapor right now and I'm not sure if various packages/plugins have the ability to provide cues to project file generator or not (i.e "please add these search paths", etc.)

natebird commented 7 years ago

If you are using it with Vapor you should be adding the https://github.com/vapor-community/postgresql-provider to the project. This is a dependency but you shouldn’t use it directly in Vapor.

joshpc commented 7 years ago

@natebird yep -- I'm using that one, which but the compilation error was within this project so I decided to start looking here.

joshpc commented 7 years ago

I think I'll close this issue for now, and look into what's really going on -- I don't think this belongs here anymore -- the compilation error was in the PostgresQL target but this dependency comes from CPostgreSQL.

Edit: Even better, after running another vapor update the issue disappeared. I noticed that the CPostgreSQL folder was completely empty -- this is prooobably user error. Sorry!

natebird commented 7 years ago

No problem. We be all been there. I’m glad you resolved it.