Windows에서 다운로드, 컴파일(메모)
3982 단어 protobuf
Protocolf는 Protocol Buffers의 약칭입니다.
Protocolf의 설계 목적은 단순성과 성능입니다.Protobuf는 실제로 Json이나 XML 등 데이터 전송 형식과 규격이다.서로 다른 응용 프로그램과 과정 간의 통신에 사용된다.
두 가지 방법이 있다.
방법1:
직접protooc-3.13.0-win64.zip을 로드합니다.
protobuf 소스 코드를 다운로드하여 github부터protooc-3.13.0-win64까지.zip을 다운로드하십시오.

내가 다운로드한 것은 《protooc-3.13.0-win64.zip》이다.
그런 다음 D:\ProgramData로 동결해제합니다.

방법2:
명령을 컴파일합니다.
준비:
1. 사용하는 컴퓨터는 win10으로 VS2019와 cmake 3.17.2가 설치되어 있다.
2. protobuf 소스 코드를 다운로드하여 github에서 ZIP 그룹을 직접 다운로드하십시오.

다양한 버전이 있으니 자신에게 맞는 버전을 다운로드하세요.
내가 다운로드한 것은 protobuf-all-3.13.0.zip이다.
그런 다음 D:\ProgramData로 동결해제합니다.
컴파일링:
64비트 debug 버전을 컴파일한 예입니다.
release 버전이면 명령별 debug 경로를 release 경로로 변경하고 명령 5의
'-DCMAKE BUILD TYPE = Debug'을'-DCMAKE BUILD TYPE = Release'로 변경한다.
[Visual Studio 2019-Visual Studio Tools]를 선택하고 [x64 Native Tools Command Proopt for VS 2019]를 두 번 클릭합니다.
1-7 명령을 순서대로 입력하십시오.
명령 1-4
d:
cd ProgramData\protobuf-3.13.0\cmake
mkdir build & cd build
mkdir x64 & cd x64
mkdir debug & cd debug

이 때protobuf-3.13.0/cmake/build/x64/debug에 위치하지만, 여기에서 만든 debug 폴더는 관련 cmake file의 설정 정보를 저장하는 데만 사용됩니다.별다른 의미가 없다.
명령
cmake -G “NMake Makefiles” -DCMAKE_BUILD_TYPE=Debug -Dprotobuf_BUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=../../../../install/x64/debug ../../../

cmake file과 관련된 구성 파일을 생성합니다.
명령
nmake
prootobuf의 컴파일링이 끝날 때까지 기다렸습니다. 저는 6분 정도 걸립니다.
명령
nmake install

완료되면protobuf-3.2\install\x64\debug 디렉터리에bin,include,lib,cmake 네 개의 폴더를 생성합니다.


환경 변수 설정
환경 변수에 bin 폴더 경로를 추가합니다.

버전 표시
버전을 표시합니다.
protoc --version

Reference
이 문제에 관하여(Windows에서 다운로드, 컴파일(메모)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/LI_MO/items/6e2635b860a4f9cce1b0텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)