wsl ubuntu-24.04에서 npm run tauri dev 오류

junyojeo·2024년 10월 25일
error: failed to run custom build command for `gdk-sys v0.18.0`

Caused by:
  process didn't exit successfully: `/home/jun/10_Octobor/snapnoteV3/snapnote/src-tauri/target/debug/build/gdk-sys-945c498cdbce2e50/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=GDK_3.0_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr

  pkg-config exited with status code 1
  > PKG_CONFIG_PATH=:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags gdk-3.0 gdk-3.0 >= 3.22

  The system library `gdk-3.0` required by crate `gdk-sys` was not found.
  The file `gdk-3.0.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  PKG_CONFIG_PATH contains the following:
      - 
      - /usr/lib/x86_64-linux-gnu/pkgconfig
      - /usr/lib/x86_64-linux-gnu/pkgconfig

  HINT: you may need to install a package such as gdk-3.0, gdk-3.0-dev or gdk-3.0-devel.

warning: build failed, waiting for other jobs to finish...

->>
PKG_CONFIG_PATH 경로 문제 때문에 생긴 일.

해결법

export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/share/pkgconfig
# 1. 현재 PKG_CONFIG_PATH 확인
echo $PKG_CONFIG_PATH

# 2. gdk-3.0.pc 파일 위치 확인
find /usr -name 'gdk-3.0.pc' 2>/dev/null

# 3. pkg-config가 gdk를 찾을 수 있는지 테스트
pkg-config --libs --cflags gdk-3.0
sudo apt install -y \
    x11proto-dev \
    libx11-dev \
    libxrender-dev \
    libxext-dev

# 설치 후 확인
pkg-config --libs --cflags gdk-3.0
profile
치킨강정

0개의 댓글