-
could not find native static library mysqlclient 오류 해결법컴퓨터/Rust 2021. 7. 10. 19:13728x90반응형
오류
Rust에서 Rocket 웹 프레임워크를 사용하다가 MySQL 연동을 하려면 diesel이 필요하다고 한다.
cli를 설치하다가 아래와 같은 오류가 발생했다.
error: could not find native static library mysqlclient, maybe an -L flag is missing?
pythoncargo install diesel_cli, error: error: could not find native static library mysqlclient, maybe an -L flag is missing? error: Could not compile mysqlclient-sys.
해결법
MySQL C API를 다운로드 한다.
MySQL :: Download MySQL Connector/C (Archived Versions)
Please note that these are old versions. New releases will have recent bug fixes and features! To download the latest release of MySQL Connector/C, please visit MySQL Downloads. MySQL open source software is provided under the GPL License.
downloads.mysql.com
환경 변수에 아래를 추가한다. (경로는 알맞게)
그러면 아래 명령어를 입력하면 정상적으로 설치된다. (Win 10 기준)
pythoncargo install diesel_cli --no-default-features --features mysql
cargo build에서 오류가 뜨면 데이터 삭제 후 다시 빌드
pythoncargo clean -p mysqlclient-sys
728x90'컴퓨터 > Rust' 카테고리의 다른 글
Rust 백엔드: REST API (Rocket + MySQL) (0) 2021.07.14 Rust 문법: dyn, trait, polymorphism (0) 2021.05.02 Rust 문법: Ownership (소유권) (0) 2021.04.24