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

肇庆市住房和城乡建设部网站宁波seo网络推广推荐

肇庆市住房和城乡建设部网站,宁波seo网络推广推荐,建设银行明细网站能查多久,阿里巴巴官方网站使用一个简单的示例来应用cmake#xff0c;无任何三方库的单一的应用程序项目 你可以收获 使用cmake生成VS项目生成mingw项目(makefile) 1 首先新建一个cpp#xff0c;我们要做一个控制台应用程序 #includeiostream void main(){std::couthello cm…使用一个简单的示例来应用cmake无任何三方库的单一的应用程序项目 你可以收获 使用cmake生成VS项目生成mingw项目(makefile) 1 首先新建一个cpp我们要做一个控制台应用程序 #includeiostream void main(){std::couthello cmake\n; }下面是CMakeLists.txt要和main.cpp放在同一目录下 当你只有一个文件 main.cpp 并想要生成一个可执行程序时你的 CMakeLists.txt 文件可以非常简单。以下是一个示例 # 设置 CMake 最低版本要求 cmake_minimum_required(VERSION 3.12)# 项目名称 project(MyExecutable)# 添加可执行文件 add_executable(my_executable main.cpp)这个 CMakeLists.txt 文件包含了三个主要部分 cmake_minimum_required(VERSION 3.12)指定 CMake 的最低版本要求。这个版本号可以根据你的需求进行修改。 project(MyExecutable)定义项目名称。在这里项目名被设置为 “MyExecutable”你可以根据需要修改。 add_executable(my_executable main.cpp)添加可执行文件。这一行告诉 CMake 创建一个名为 my_executable 的可执行文件它的源代码是 main.cpp。确保 main.cpp 文件与 CMakeLists.txt 文件在同一目录下或者根据实际情况提供正确的路径。 2 在项目目录中创建一个 build 目录并在其中运行 CMake 和构建命令 mkdir build cd build cmake .. cmake --build .这样就会在 build 目录中生成一个名为 my_executable 的可执行文件。 cmake …配置项目生成构建系统文件。 cmake --build .使用生成的构建系统文件实际构建项目。这个可不用执行因为VS提供可视化的编译。只用打开生成的sln文件再使用VSbuild。 执行之后 PS E:\workspace\cmake_demo\simple_demo\build cmake .. -- Building for: Visual Studio 16 2019 -- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22631. -- The C compiler identification is MSVC 19.29.30153.0 -- The CXX compiler identification is MSVC 19.29.30153.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: E:/VS/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: E:/VS/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done (6.3s) -- Generating done (0.0s) -- Build files have been written to: E:/workspace/cmake_demo/simple_demo/build PS E:\workspace\cmake_demo\simple_demo\build cmake --build . 用于 .NET Framework 的 Microsoft (R) 生成引擎版本 16.11.2f32259642 版权所有(C) Microsoft Corporation。保留所有权利。my_executable.vcxproj - E:\workspace\cmake_demo\simple_demo\build\Debug\my_executable.exeBuilding Custom Rule E:/workspace/cmake_demo/simple_demo/CMakeLists.txt PS E:\workspace\cmake_demo\simple_demo\buildbuild 目录下新增了如下文件 Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2023/12/16 2:50 CMakeFiles d----- 2023/12/16 2:44 Debug d----- 2023/12/16 2:44 my_executable.dir d----- 2023/12/16 2:44 x64 -a---- 2023/12/16 2:42 38740 ALL_BUILD.vcxproj -a---- 2023/12/16 2:42 290 ALL_BUILD.vcxproj.filters -a---- 2023/12/16 2:44 168 ALL_BUILD.vcxproj.user -a---- 2023/12/16 2:42 13988 CMakeCache.txt -a---- 2023/12/16 2:42 1459 cmake_install.cmake -a---- 2023/12/16 2:42 3126 MyExecutable.sln -a---- 2023/12/16 2:42 48205 my_executable.vcxproj -a---- 2023/12/16 2:42 583 my_executable.vcxproj.filters -a---- 2023/12/16 2:44 168 my_executable.vcxproj.user -a---- 2023/12/16 2:42 38830 ZERO_CHECK.vcxproj -a---- 2023/12/16 2:42 533 ZERO_CHECK.vcxproj.filters其中ALL_BUILD和ZERO_CHECK是cmake附加的一个是可以编译所有项目的项目一个是重新生成VS项目 3 刚刚生成了VS的文件现在生成makefile文件 使用-G命令来指定编译器 -G generator-name Specify a build system generator. 使用cmake -h来查看帮助看看编译器的名字 GeneratorsThe following generators are available on this platform (* marks default):Visual Studio 17 2022 Generates Visual Studio 2022 project files.Use -A option to specify architecture. * Visual Studio 16 2019 Generates Visual Studio 2019 project files.Use -A option to specify architecture.MinGW Makefiles Generates a make file for use withmingw32-make. 多余的我就删去了不然太长以下是一个在 MinGW 下使用 Makefile 的示例 mkdir build_mingw cd build_mingw cmake -G MinGW Makefiles ..执行之后 PS E:\workspace\cmake_demo\simple_demo\build_mingw cmake -G MinGW Makefiles .. -- The C compiler identification is GNU 8.1.0 -- The CXX compiler identification is GNU 8.1.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: E:/MinGW/mingw64/bin/gcc.exe - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: E:/MinGW/mingw64/bin/c.exe - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Configuring done (2.4s) -- Generating done (0.0s) -- Build files have been written to: E:/workspace/cmake_demo/simple_demo/build_mingw至此以及生成了makefile 然后你可以使用 mingw32-make 命令来构建项目 生成了可执行文件 [ 50%] Building CXX object CMakeFiles/my_executable.dir/main.cpp.obj [100%] Linking CXX executable my_executable.exe [100%] Built target my_executable在makefile的环境下因为没有IDE可视化的支持因此一般将cmake 和make(mingw32-make)连用在Cmake生成makefile时就指定64位还是32位debug还是release。 cmake -G MinGW Makefiles -DCMAKE_C_FLAGS-m64 -DCMAKE_BUILD_TYPERelease .. 64可以换成32Release 可以换成Debug 后面的文章中在讨论项目配置的问题这篇文章主要是体会一下cmake生成和编译的步骤
http://www.hkea.cn/news/14310939/

相关文章:

  • 谷歌网站流量统计网络推广包括什么内容
  • 网站开发用到哪些技术购买网站广告位
  • 建设通官方网站网站怎么增加流量
  • 网站备案 空间自己做网站要钱么
  • 做网站.服务器怎么买wordpress人性化主题
  • 如何分析企业网站淘宝客网站素材
  • 带网站的图片素材广州邮局网站
  • 怎样将自己做的网页加入网站厦门做网站的公司
  • wordpress建站文本教程如何拷贝网站代码
  • 网站建设开票属于什么服务网站建站客户需求表单
  • 检察 网站建设建设网站的法律可行性分析
  • 网站搭建文案WordPress将开发
  • iis7.5添加php网站WordPress post登录
  • 网站建设廉政风险点北京公司公示在哪个网站
  • 网站开发毕设题目网站集成微信登陆
  • 比较好的网站公司吗成都网站设计推荐
  • 公司的网站建设注意点网站开发合同免费模板
  • 代理网站备案表出售自己的网站
  • wordpress漏洞复现知乎seo排名的搜软件
  • 网站做的比较好的贸易公司wordpress 缓存时间
  • 南通网站制作公司北京网络营销策划公司
  • 网站域名列表怎么填写建网站网络推广优势
  • 网站不能自行备案吗株洲网络学院登录
  • 上海网站建设推荐广州 网站开发 app
  • 德邦公司网站建设特点网站建设zrhskj
  • 江苏建设厅网站查询网页视频下载安卓
  • 金华建设网站太原商城网站建设
  • 商业类网站的设计与制作页面禁止访问
  • 做培训的网站建设贵州城乡住房和建设厅网站
  • 网站建设服务费进入什么科目网站后台搭建图文