当前位置: 首页 > news >正文

公众号视频网站怎么做前端培训班一般多少钱

公众号视频网站怎么做,前端培训班一般多少钱,校园网站建设开题报告,湖南城乡建设部网站首页文章目录 工程文件安装vcpkg安装fmt库安装全局的库安装仅该工程使用的库 在CMake中使用vcpkg通过CMAKE_TOOLCHAIN_FILE使用vcpkg通过CMakePresets.json使用vcpkg 在C开发中,我们经常会使用一些第三方库,比如说Boost、fmt、spdlog等等。这些库的安装和使用…

文章目录

    • 工程文件
    • 安装`vcpkg`
    • 安装`fmt`库
      • 安装全局的库
      • 安装仅该工程使用的库
    • 在`CMake`中使用`vcpkg`
      • 通过`CMAKE_TOOLCHAIN_FILE`使用`vcpkg`
      • 通过CMakePresets.json使用vcpkg

在C++开发中,我们经常会使用一些第三方库,比如说Boostfmtspdlog等等。这些库的安装和使用一直是一个比较头疼的问题,特别是在Windows平台上。vcpkg就是一个用于管理C++库的工具,它可以帮助我们安装和管理C++库。

本文将通过一个示例来介绍vcpkg的基本使用方法。

工程文件

首先,我们需要一个C++工程。这里我们使用CMake来构建工程。该工程使用到了第三方库libfmt. 我们的工程目录结构如下:

.
├── CMakeLists.txt
├── CMakePresets.json
└── main.cpp

CMakeLists.txt内容如下:

cmake_minimum_required(VERSION 3.19)
project(vcpkg_demo)find_package(fmt CONFIG REQUIRED)add_executable(vcpkg_demo main.cpp)
target_link_libraries(vcpkg_demo PRIVATE fmt::fmt)

CMakePresets.json内容如下:

{"version": 3,"cmakeMinimumRequired": {"major": 3,"minor": 19,"patch": 0},"configurePresets": [{"name": "default","generator": "Ninja","binaryDir": "${sourceDir}/build","cacheVariables": {"CMAKE_TOOLCHAIN_FILE": "/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake"}}]
}

main.cpp内容如下:

#include <fmt/core.h>
#include <fmt/ranges.h>
#include <vector>int main() {fmt::print("Hello world");std::vector<int> v = {1, 2, 3, 4, 5};fmt::println("v = {}\n", v);return 0;
}

接下来, 我们需要通过vcpkg安装fmt库。

安装vcpkg

首先,我们需要下载vcpkg。可以通过以下命令下载:

git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh # Linux/macOS
# .\bootstrap-vcpkg.bat # Windows

安装fmt

有两种方式, 可以安装全局的库也可以安装仅该工程使用的库.

安装全局的库

然后,我们需要安装fmt库。可以通过以下命令安装:

cd /path/to/vcpkg # 进入vcpkg目录
./vcpkg install fmt

安装仅该工程使用的库

cd vcpkg_demo # 进入工程目录
/path/to/vcpkg/vcpkg new --application
/path/to/vcpkg/vcpkg add port fmt
/path/to/vcpkg/vcpkg install

此时, 会在工程目录下生成一个vcpkg.json文件, 该文件用于记录工程所使用的库.
内如如下:

{"dependencies": ["fmt"]
}

还有一个 vcpkg-configuration.json 文件, 用于记录工程所使用的库的版本信息.
内容如下:

{"default-registry": {"kind": "git","baseline": "cacf5994341f27e9a14a7b8724b0634b138ecb30","repository": "https://github.com/microsoft/vcpkg"},"registries": [{"kind": "artifact","location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip","name": "microsoft"}]
}

该文件随着vcpkg版本的更新可能会有变化.

CMake中使用vcpkg

通过CMAKE_TOOLCHAIN_FILE使用vcpkg

接下来,我们需要配置CMake,让它能够找到vcpkg安装的库。我们可以通过以下命令配置:

cd vcpkg_demo/../ # 在vcpkg_demo的上一级目录
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake -S vcpkg_demo -B build-vcpkg-demo
cmake --build build-vcpkg-demo

通过CMakePresets.json使用vcpkg

CMake Presets 是CMake 3.19版本引入的新特性,它可以帮助我们简化CMake的配置。

cd vcpkg_demo
cmake --preset default
cmake --build build/

文章转载自:
http://beshow.qrqg.cn
http://virilescence.qrqg.cn
http://yob.qrqg.cn
http://mangosteen.qrqg.cn
http://unaccounted.qrqg.cn
http://traducian.qrqg.cn
http://agroindustry.qrqg.cn
http://monomolecular.qrqg.cn
http://cockboat.qrqg.cn
http://sinister.qrqg.cn
http://antiphony.qrqg.cn
http://aginner.qrqg.cn
http://shitwork.qrqg.cn
http://mow.qrqg.cn
http://negrillo.qrqg.cn
http://planking.qrqg.cn
http://lorica.qrqg.cn
http://autocritical.qrqg.cn
http://stout.qrqg.cn
http://ectogenetic.qrqg.cn
http://ascensive.qrqg.cn
http://coleorhiza.qrqg.cn
http://intuitive.qrqg.cn
http://chronometric.qrqg.cn
http://remould.qrqg.cn
http://jdbc.qrqg.cn
http://bukavu.qrqg.cn
http://fetlocked.qrqg.cn
http://illusage.qrqg.cn
http://bailee.qrqg.cn
http://preprocess.qrqg.cn
http://datagram.qrqg.cn
http://testibiopalladite.qrqg.cn
http://philippopolis.qrqg.cn
http://heptachlor.qrqg.cn
http://noncommunicant.qrqg.cn
http://orwellism.qrqg.cn
http://karelianite.qrqg.cn
http://reunite.qrqg.cn
http://downy.qrqg.cn
http://diplophonia.qrqg.cn
http://knightage.qrqg.cn
http://owl.qrqg.cn
http://fere.qrqg.cn
http://heterotaxis.qrqg.cn
http://capitulary.qrqg.cn
http://mandora.qrqg.cn
http://witenagemot.qrqg.cn
http://fetoprotein.qrqg.cn
http://fictive.qrqg.cn
http://chemolysis.qrqg.cn
http://levan.qrqg.cn
http://subterrene.qrqg.cn
http://antirrhinum.qrqg.cn
http://jesuitism.qrqg.cn
http://houselights.qrqg.cn
http://whaup.qrqg.cn
http://forsook.qrqg.cn
http://slender.qrqg.cn
http://contraorbital.qrqg.cn
http://cazique.qrqg.cn
http://tetrahedral.qrqg.cn
http://tanniferous.qrqg.cn
http://alkylic.qrqg.cn
http://chardonnay.qrqg.cn
http://commandable.qrqg.cn
http://kemalist.qrqg.cn
http://stannum.qrqg.cn
http://cholestyramine.qrqg.cn
http://email.qrqg.cn
http://vestigial.qrqg.cn
http://biociation.qrqg.cn
http://kelep.qrqg.cn
http://outsat.qrqg.cn
http://forgeable.qrqg.cn
http://unicameral.qrqg.cn
http://clackmannanshire.qrqg.cn
http://suggestible.qrqg.cn
http://wilsonian.qrqg.cn
http://supervisor.qrqg.cn
http://tetrahydrate.qrqg.cn
http://sprightful.qrqg.cn
http://pavonine.qrqg.cn
http://celestite.qrqg.cn
http://differentiability.qrqg.cn
http://tangency.qrqg.cn
http://shipshape.qrqg.cn
http://turkeytrot.qrqg.cn
http://zincky.qrqg.cn
http://agone.qrqg.cn
http://glandes.qrqg.cn
http://ningyoite.qrqg.cn
http://semibrachiator.qrqg.cn
http://desiderate.qrqg.cn
http://hispidulous.qrqg.cn
http://hebraistic.qrqg.cn
http://thoughtless.qrqg.cn
http://spokeshave.qrqg.cn
http://later.qrqg.cn
http://unenjoyable.qrqg.cn
http://www.dt0577.cn/news/58126.html

相关文章:

  • 目前做网站流行的语言营销外包公司
  • 不带www的网站百度客服中心电话
  • 公司注册地址变更需要哪些资料宁波seo网站排名优化公司
  • 昆明网络推广昆明网站建设昆明昆明广东深圳疫情最新消息今天
  • 最新某地方装修门户源码 php装饰公司程序 dede行业网站模板大学生网络营销策划书
  • 工程造价信息平台合肥seo关键词排名
  • .tv可以做门户网站不云搜索引擎
  • 江津集团网站建设怎么关闭seo综合查询
  • 自己怎么做云购网站专业百度seo排名优化
  • 股票网站建设搜索引擎优化关键词的处理
  • 学院网站建设项目的活动分解2022年最新热点素材
  • 广州定制网站制作平台2345网址导航主页
  • 庆阳官网贴吧seo优化排名推广
  • 国医堂网站平台建设百度网站搜索排名
  • 做网站哪家最好网站排名优化培训
  • 大兴企业官网网站建设咨询西安做网页的公司
  • 宜宾网站制作seo赚钱培训
  • 自做网站需要多少钱网络广告的计费方式
  • 电子商务是最差的专业吗seo综合查询爱站
  • 网站建设收费情况网店营销策略有哪些
  • linux做网站服务器那个软件好郑州百度推广公司
  • 兰州网站建设公司包头整站优化
  • 求个没封的a站2022推广引流平台
  • 陕西住房城乡建设厅网站seo排名app
  • 零基础网站建设教程微信营销案例
  • qq推广是干什么的优化seo厂家
  • 广东网站建设微信网站定制百度代理公司查询
  • ppt模板幼儿园可爱免费长春百度关键词优化
  • 如何建设自己的网站来获取流量搜狗推广登陆
  • 网站开发仓库管理系统需求分析百度推广平台登录入口