Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building Linux Mint - cannot find sqlite3 #57

Closed
davidpbrown opened this issue Aug 1, 2015 · 5 comments
Closed

Error building Linux Mint - cannot find sqlite3 #57

davidpbrown opened this issue Aug 1, 2015 · 5 comments

Comments

@davidpbrown
Copy link

I'm getting this error below and for searching cannot see a way through it.
sqlite3 is installed and working fine.

I cannot see sqlite3.pc or similar and I'm not familiar with those .pc files then to know an obvious answer.

Curious that majkcramer commented in May on the other issue that he's been successful in Linux.. I tried building only this from git clone too but same error.

I'm using Cargo build; unsure what the rustc equivalent to Cargo.toml is to try rustc but I would expect the same error perhaps will follow from that too.

       Fresh libc v0.1.8
       Fresh winapi v0.2.1
       Fresh pkg-config v0.3.5
   Compiling libsqlite3-sys v0.2.0 (file:///home/davidpbrown/rust/firefox/rusqlite)
     Running `/home/davidpbrown/rust/firefox/rusqlite/target/debug/build/libsqlite3-sys-863cdbd64abd8e99/build-script-build`
       Fresh bitflags v0.1.1
       Fresh winapi-build v0.1.1
       Fresh advapi32-sys v0.1.2
       Fresh rand v0.3.9
       Fresh tempdir v0.3.4
       Fresh kernel32-sys v0.1.3
       Fresh time v0.1.32
failed to run custom build command for `libsqlite3-sys v0.2.0 (file:///home/davidpbrown/rust/firefox/rusqlite)`
Process didn't exit successfully: `/home/davidpbrown/rust/firefox/rusqlite/target/debug/build/libsqlite3-sys-863cdbd64abd8e99/build-script-build` (exit code: 101)
--- stderr
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: "`\"pkg-config\" \"--libs\" \"--cflags\" \"sqlite3\"` did not exit successfully: exit code: 1\n--- stderr\nPackage sqlite3 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `sqlite3.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'sqlite3\' found\n"', ../src/libcore/result.rs:732
@jgallagher
Copy link
Contributor

sqlite3.pc is the configuration file that should be installed so you can use pkg-config to figure out where the headers / library files are located. I haven't used Linux Mint, but I know on some systems, you have to install a -dev version of the sqlite package to get the headers and .pc file (e.g., libsqlite3-dev on Debian). Does it look like there's an equivalent on Mint?

@davidpbrown
Copy link
Author

Yes.. it needed libsqlite3-dev .. thanks!

@doabit
Copy link

doabit commented Oct 9, 2015

@jgallagher I have the same problem on osx el.

   Compiling libsqlite3-sys v0.2.0
failed to run custom build command for `libsqlite3-sys v0.2.0`
Process didn't exit successfully: `/Users/doabit/Codes/rust/projects/TencentOAuth/target/debug/build/libsqlite3-sys-2fe684602508b1c3/build-script-build` (exit code: 101)
--- stderr
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: "`\"pkg-config\" \"--libs\" \"--cflags\" \"sqlite3\"` did not exit successfully: exit code: 1\n--- stderr\nPackage sqlite3 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `sqlite3.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'sqlite3\' found\n"', ../src/libcore/result.rs:736

I've installed pkg-config and sqlite3 with homebrew.

@doabit
Copy link

doabit commented Oct 9, 2015

Ok, use PKG_CONFIG_PATH=echo /usr/local/Cellar/sqlite/*/lib/pkgconfig/ cargo build can build success.

@dashed
Copy link

dashed commented Oct 27, 2015

@doabit thanks! PKG_CONFIG_PATH=$(echo /usr/local/Cellar/sqlite/3.9.1/lib/pkgconfig/) cargo run works for me

dashed referenced this issue Jan 18, 2016
* If SQLITE3_LIB_DIR is present in the environment, we use that.
* If SQLITE3_LIB_DIR is not present, we try to use pkg-config.
* If SQLITE3_LIB_DIR is not present and pkg-config fails, we fall back
  to /usr/lib (if it exists).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants