cargo-c

(★ 545)

build and install C-compatible libraries

  • .gitignore
  • Cargo.toml
  • codecov.yml
  • coverage.sh
  • LICENSE
  • README.md

# 설치 가이드

1. 코드 내려받기
git clone https://github.com/lu-zero/cargo-c

깃허브에서 프로젝트 코드 전체를 내 컴퓨터로 내려받습니다.

cd cargo-c

방금 내려받은 프로젝트 폴더 안으로 이동합니다.

2. Rust

보통 추천
사전 준비물
  • Git GitHub에서 프로젝트 코드를 내려받으려면 필요합니다.
  • Rust (rustup) rustup으로 설치하면 cargo도 함께 설치됩니다.
The `rustc` version supported is the same as the one supported by the `cargo` version embedded in the package version, or as set in the

이 명령어를 터미널에 그대로 입력해 실행하세요.

[rust-version](https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field) field.

이 명령어를 터미널에 그대로 입력해 실행하세요.

You must have the **cargo** build [requirements](https://github.com/rust-lang/cargo#compiling-from-source) satisfied in order to build **cargo-c**:

이 명령어를 터미널에 그대로 입력해 실행하세요.

For a more in-depth explanation of how `cargo-c` works and how to use it for

이 명령어를 터미널에 그대로 입력해 실행하세요.

- ~~Since Rust 1.38, also add "staticlib" to the "lib" `crate-type`.~~ Do not specify the `crate-type`, cargo-c will add the correct library target by itself.

이 명령어를 터미널에 그대로 입력해 실행하세요.

cargo build가 에러 없이 끝나면 성공입니다. target/ 폴더에 실행 파일이 생성됩니다.

이 레포의 README에 적힌 실제 명령어를 그대로 가져왔습니다.

3. Make

보통
사전 준비물
  • Git GitHub에서 프로젝트 코드를 내려받으려면 필요합니다.
  • Make Linux/macOS는 보통 기본 설치되어 있습니다. Windows는 별도 설치(예: MSYS2, WSL)가 필요합니다.
⚠️ 이 프로젝트는 규모가 큰 저장소라, 이 방법이 실제 핵심 제품이 아니라 내부 하위 패키지를 가리키는 것일 수 있습니다. README 전체를 함께 확인해보세요.
cd example-project/usage-from-c

이 프로젝트의 관련 파일이 하위 폴더 안에 있어서, 먼저 그 폴더로 이동합니다.

make

생성된 빌드 설정을 바탕으로 실제 컴파일을 진행해 실행 파일을 만듭니다.

에러 없이 끝나면 성공입니다. 생성된 실행 파일을 직접 실행해보세요.
// repository documentation