在虛擬機ubuntu下 編譯 protobuf-c for hi3516ev300

1.在宿主虛擬機下安裝 protobuf

 

版本是 protobuf-2.6.1 不要在 windows 的共享文件夾裏面安裝 可能會 bug

1. 先安裝依賴庫 automake ,autoconf ,libtool 

2. ./configure 

3. make

4. make cheak

5. sudo make install

 

可能會出現錯誤或者還是顯示的老版本號,錯誤原因:protobuf的默認安裝路徑是/usr/local/lib,而/usr/local/lib不在ubuntu體系默認的LD_LIBRARY_PATH裏,所以就找不到lib

 

解決辦法:

 

1.執行命令

 

nano ~/.profile # 打開配置文件

 

在文件最後添加:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

 

2.保存退出,並執行下面命令

 

source ~/.profile

 

3.然後,查看版本號

 

protoc --version

 

2.編譯protobuf-c的PC版(這一步或許不用)

1. 下載protobuf-c1.2版本 或者 protobuf-c-master ,這裏使用了 protobuf-c1.2

2. ./configure

3. make

4. make install

 

3.編譯protobuf-c的arm版本 arm-himix100-linux 是對應的arm編譯器

1. ./configure --host=arm-himix100-linux --disable-protoc

2. make

3. 在./protobuf-c/.libs的目錄下可以看到 .a .so 等編譯文件,複製到 相應的項目中

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章