![NixOS에서는 -lfl을 사용할 수 없습니다.](https://linux55.com/image/189528/NixOS%EC%97%90%EC%84%9C%EB%8A%94%20-lfl%EC%9D%84%20%EC%82%AC%EC%9A%A9%ED%95%A0%20%EC%88%98%20%EC%97%86%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
저는 NixOS를 처음 접했고 Flex를 사용하는 프로젝트를 빌드하려고 합니다. 프로젝트를 빌드하려고 하면 다음 오류가 발생합니다.
/nix/store/b10shv9yqbgps47y0n8x7l7bq8fmp1i6-binutils-2.31.1/bin/ld: cannot find -lfl
어떻게 해결할 수 있나요?
NixOS에서 "ld: 찾을 수 없음 -lc"glibc.static
shell.nix에 추가해야 한다는 것을 보여주지만 buildInputs
아직 아무것도 해결되지 않았습니다.
편집 : 이것은shell.nix
{ pkgs ? import <nixpkgs> {} }
with pkgs;
stdenv.mkDerivation {
buildInputs = {
name = "my-project";
buildInputs = [ flex ]
}
}
답변1
나는 그것을 해결했다! make 파일에 추가하십시오:
FLEX_PATH := $(shell dirname $(shell which flex))
LIB_PATH := $(shell readlink -f "$(FLEX_PATH)/../lib")
clang ... -L $(LIB_PATH) -lfl ...