FAQ: Difference between revisions
imported>Samueldr m Fixes wrong header markup (h1→h2) |
imported>Lheckemann No edit summary |
||
| Line 9: | Line 9: | ||
== I installed a library but my compiler is not finding it. Why? == | == I installed a library but my compiler is not finding it. Why? == | ||
With nix, only ''applications'' should be installed into profiles. Libraries are used using nix-shell. If you want to compile a piece of software that requires zlib and uses pkg-config to discover it, run <code>nix-shell -p pkgconfig zlib</code> to get into a shell with the appropriate environment variables set. In there, a configure script will work as expected. | With nix, only ''applications'' should be installed into profiles. Libraries are used using nix-shell. If you want to compile a piece of software that requires zlib and uses pkg-config to discover it, run <code>nix-shell -p gcc pkgconfig zlib</code> to get into a shell with the appropriate environment variables set. In there, a configure script will work as expected. | ||
This applies to other language environments too. In some cases the expressions to use are a bit different, e.g. because the interpreter needs to be wrapped to have some additional environment variables passed to it. The manual has [https://nixos.org/nixpkgs/manual/#chap-language-support a section] on the subject. | This applies to other language environments too. In some cases the expressions to use are a bit different, e.g. because the interpreter needs to be wrapped to have some additional environment variables passed to it. The manual has [https://nixos.org/nixpkgs/manual/#chap-language-support a section] on the subject. | ||