zoukankan      html  css  js  c++  java
  • protobuf-3.0.0-beta-2 windows编译 x64/x86

    V3.0.0 beta2以及之后都是CMake 创建VS Solution,project。 因为只能创建x64的项目工程,有时候需要x86的, 只能创建完x64后,自己修改工程配置弄成x86。

    创建步骤参考 protobuf-3.0.0-beta-2/cmake/readme.md

     C:Path	oprotobufcmakeuild>mkdir release & cd release
     C:Path	oprotobufcmakeuild
    elease>cmake -G "NMake Makefiles" ^
     -DCMAKE_BUILD_TYPE=Release ^
     -DCMAKE_INSTALL_PREFIX=../../../../install ^
     ../..
    
    C:Path	oprotobufcmakeuild>mkdir debug & cd debug
     C:Path	oprotobufcmakeuilddebug>cmake -G "NMake Makefiles" ^
     -DCMAKE_BUILD_TYPE=Debug ^
     -DCMAKE_INSTALL_PREFIX=../../../../install ^
     ../..
    
     C:Path	oprotobufcmakeuild>mkdir solution & cd solution
     C:Path	oprotobufcmakeuildsolution>cmake -G "Visual Studio 14 2015 Win64" ^
     -DCMAKE_INSTALL_PREFIX=../../../../install ^
     ../..
    
    

    cmake -G "Visual Studio 14 2015 Win64" ^
    这里cmake只能创建x64的工程属性,要不然是ARM的。 参考 https://cmake.org/cmake/help/v3.3/generator/Visual Studio 14 2015.html

    只能生成x64的之后,在VS工程属性中 【Link】
    修改
    【TargetMachine】
    【addition options】

    release 默认, debug 有debug

    x86 ,x64

    都有不同,看下拉设置。

    To compile protobuf:

    C:Path oprotobufcmakeuild elease>nmake
    or

    C:Path oprotobufcmakeuilddebug>nmake

    Testing

    To run unit-tests:

    C:Path oprotobufcmakeuild elease>nmake check
    or

    C:Path oprotobufcmakeuilddebug>nmake check

    Installing

    To install protobuf to the specified install folder:

    C:Path oprotobufcmakeuild elease>nmake install
    or

    C:Path oprotobufcmakeuilddebug>nmake install

  • 相关阅读:
    强化学习基础
    大数据核心技术
    大数据用到哪些技术?
    机器学习算法
    机器学习概述
    java进程占用系统内存高,排查解决
    Vmbox Centos7安装完毕后无法联网的解决方法
    Java使用枚举优化大量if else
    java解析多级Json中的数组
    VSCODE安装美化JSON插件
  • 原文地址:https://www.cnblogs.com/scotth/p/5267435.html
Copyright © 2011-2022 走看看