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

燕郊网站制作多少钱短链接生成网址

燕郊网站制作多少钱,短链接生成网址,客户做网站一定报价怎么办,简述电子商务网站的建站流程目录 一、问题背景 二、问题分析 三、问题解决 一、问题背景 VS2022中能够跨平台的工程类型就是CMake项目,一套代码能跨windows/Linux/Mac多种操作系统。而实际使用时,发现相关资料比较少,需要摸索一下。 碰到的问题简述: 1、C…

目录

一、问题背景

二、问题分析

三、问题解决


一、问题背景

       VS2022中能够跨平台的工程类型就是CMake项目,一套代码能跨windows/Linux/Mac多种操作系统。而实际使用时,发现相关资料比较少,需要摸索一下。

 碰到的问题简述:

 

1、C++ Intellisense信息可能过时,生成要刷新的CMake缓存。

2、多次定义了变量 CMAKE_INSTALL_PREFIX

3、CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.  4、CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage    

5、CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage         

 二、问题分析

CMake工程中最重要的文件就是CMakeLists文件,其包含工程所有需要的元素,例如下面这个demo。直接用CMakeLists会觉得难用;但用了makefile再用这个就觉得CMakeLists十分友好了。

# CMakeList.txt: CMakeProject1 的 CMake 项目,在此处包括源代码并定义
# 项目特定的逻辑。
#
cmake_minimum_required (VERSION 3.8)# 如果支持,请为 MSVC 编译器启用热重载。
if (POLICY CMP0141)cmake_policy(SET CMP0141 NEW)set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
endif()project ("CMakeProject1")# 将源代码添加到此项目的可执行文件。
add_executable (CMakeProject1 "CMakeProject1.cpp" "CMakeProject1.h")if (CMAKE_VERSION VERSION_GREATER 3.12)set_property(TARGET CMakeProject1 PROPERTY CXX_STANDARD 20)
endif()# TODO: 如有需要,请添加测试并安装目标。

如果上面的demo看不懂,建议先恶补一下,不然下面的内容会比较吃力。

VS创建CMake工程时,默认会创建一个CMakePresets.json文件。

 例如本地计算机的x64-Debug工程属性由下面的json片段来描述。这个片段把CMake要用的c/c++编译器进行了定义(cl.exe)。

       {"name": "windows-base","hidden": true,"generator": "Ninja","binaryDir": "${sourceDir}/out/build/${presetName}","installDir": "${sourceDir}/out/install/${presetName}","cacheVariables": {"CMAKE_C_COMPILER": "cl.exe","CMAKE_CXX_COMPILER": "cl.exe"},"condition": {"type": "equals","lhs": "${hostSystemName}","rhs": "Windows"}},{"name": "x64-debug","displayName": "x64 Debug","inherits": "windows-base","architecture": {"value": "x64","strategy": "external"},"cacheVariables": {"CMAKE_BUILD_TYPE": "Debug"}}

然而,这个json文件对于linux和mac的描述则不完整,以下为linux-debug工程属性,其中对c/c++编译器没有定义。

{"name": "linux-debug","displayName": "Linux Debug","generator": "Ninja","binaryDir": "${sourceDir}/out/build/${presetName}","installDir": "${sourceDir}/out/install/${presetName}","cacheVariables": {"CMAKE_BUILD_TYPE": "Debug"},"condition": {"type": "equals","lhs": "${hostSystemName}","rhs": "Linux"},"vendor": {"microsoft.com/VisualStudioRemoteSettings/CMake/1.0": {"sourceDir": "$env{HOME}/.vs/$ms{projectDirName}"}}
}

这就是把本地计算机工程改为远程Linux工程时,vs报错的原因了。猜想vs的开发工程师在做这个功能时,只针对本地window环境编写了完整的CMakePresets.json,而针对其他平台只写了一段参考,其实现并不完整,需要用户手动配置缺失部分。例如,配置Linux系统中CMake用到的c/c++编译器,Ninjia路径等。可以参考一下官方的文档

使用 CMake 预设进行配置和生成 | Microsoft Learn

三、问题解决

有了第二部分的分析,解决问题的思路就有了,把相关的配置补充完整。

首先,补充c/c++编译器,linux机器上已经装了gcc/g++,直接填好就可以了。

(如果没有安装需要在linux安装一下 apt install gcc g++)

        {"name": "linux-debug","displayName": "Linux Debug","generator": "Ninja","binaryDir": "${sourceDir}/out/build/${presetName}","installDir": "${sourceDir}/out/install/${presetName}","cacheVariables": {"CMAKE_BUILD_TYPE": "Debug","CMAKE_C_COMPILER": "gcc","CMAKE_CXX_COMPILER": "g++"}

改了以后,这两个报错没有了。

4、CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage    

5、CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage  

 上面的错误显示查询ninja版本号时失败了。装一个ninja:

sudo apt install ninja-build

安装完成后,回到vs中,按ctrl+S,保存工程时,会自动再次构建工程,发现构建成功。

最后,虽然构建成功了,实际上有个错误最后还是没有解决,即使它不影响工程的构建结果。

多次定义了变量 CMAKE_INSTALL_PREFIX

从构建日志看出,CMAKE_INSTALL_PREFIX,确实定义了两次。感觉这就是vs的一个bug,有博友知道如何解决,请评论告知,十分感谢。

/usr/bin/cmake -G "Ninja"   -DCMAKE_BUILD_TYPE:STRING="Debug" -DCMAKE_C_COMPILER:STRING="gcc" -DCMAKE_CXX_COMPILER:STRING="g++" -DCMAKE_INSTALL_PREFIX:PATH="/root/.vs/CMakeProject1/out/install/linux-debug"   -DCMAKE_INSTALL_PREFIX:PATH="/root/.vs/CMakeProject1/out/install/linux-debug"  /root/.vs/CMakeProject1/CMakeLists.txt

 


文章转载自:
http://magnesia.xxhc.cn
http://changeably.xxhc.cn
http://pharmaceutic.xxhc.cn
http://unpowered.xxhc.cn
http://compelling.xxhc.cn
http://lutrine.xxhc.cn
http://displode.xxhc.cn
http://processable.xxhc.cn
http://indoctrinate.xxhc.cn
http://porraceous.xxhc.cn
http://rarest.xxhc.cn
http://gymnocarpous.xxhc.cn
http://review.xxhc.cn
http://uninjured.xxhc.cn
http://subbituminous.xxhc.cn
http://anesthetize.xxhc.cn
http://birdseed.xxhc.cn
http://bandeau.xxhc.cn
http://disnature.xxhc.cn
http://birch.xxhc.cn
http://annul.xxhc.cn
http://suave.xxhc.cn
http://salability.xxhc.cn
http://anchor.xxhc.cn
http://miai.xxhc.cn
http://bannister.xxhc.cn
http://simoom.xxhc.cn
http://calabar.xxhc.cn
http://moonfall.xxhc.cn
http://inexactly.xxhc.cn
http://blavatsky.xxhc.cn
http://omnicompetent.xxhc.cn
http://legislatress.xxhc.cn
http://overtalk.xxhc.cn
http://mediumistic.xxhc.cn
http://visionless.xxhc.cn
http://acronymize.xxhc.cn
http://falsity.xxhc.cn
http://tort.xxhc.cn
http://sambuke.xxhc.cn
http://substitutionary.xxhc.cn
http://claustrophobic.xxhc.cn
http://uncharming.xxhc.cn
http://finder.xxhc.cn
http://ccw.xxhc.cn
http://tetrapylon.xxhc.cn
http://lysimeter.xxhc.cn
http://entreasure.xxhc.cn
http://kea.xxhc.cn
http://randomizer.xxhc.cn
http://breechclout.xxhc.cn
http://socotra.xxhc.cn
http://outscorn.xxhc.cn
http://cultureless.xxhc.cn
http://cordoba.xxhc.cn
http://tawny.xxhc.cn
http://spermatophorous.xxhc.cn
http://trueheartedness.xxhc.cn
http://asphaltic.xxhc.cn
http://dilettantist.xxhc.cn
http://astilbe.xxhc.cn
http://stracciatella.xxhc.cn
http://galumph.xxhc.cn
http://unrevenged.xxhc.cn
http://academical.xxhc.cn
http://cession.xxhc.cn
http://ibadan.xxhc.cn
http://timesaver.xxhc.cn
http://retexture.xxhc.cn
http://overrun.xxhc.cn
http://nunhood.xxhc.cn
http://headlike.xxhc.cn
http://hydro.xxhc.cn
http://slic.xxhc.cn
http://hole.xxhc.cn
http://riven.xxhc.cn
http://imbalance.xxhc.cn
http://featherheaded.xxhc.cn
http://creatrix.xxhc.cn
http://ventriloquist.xxhc.cn
http://photoconductor.xxhc.cn
http://liberte.xxhc.cn
http://furuncle.xxhc.cn
http://wusih.xxhc.cn
http://mcmlxxvi.xxhc.cn
http://schoolteaching.xxhc.cn
http://raysistor.xxhc.cn
http://barky.xxhc.cn
http://pe.xxhc.cn
http://somniferous.xxhc.cn
http://laudability.xxhc.cn
http://eaprom.xxhc.cn
http://repay.xxhc.cn
http://seller.xxhc.cn
http://awninged.xxhc.cn
http://nonprofessional.xxhc.cn
http://thuggery.xxhc.cn
http://petrographical.xxhc.cn
http://eurythmy.xxhc.cn
http://epichlorohydrin.xxhc.cn
http://www.dt0577.cn/news/59913.html

相关文章:

  • c 做网站怎么居中宁波网站建设与维护
  • 网站建设的运用场景软文推广文章范文1000
  • 建设网站要什么电脑枫林seo工具
  • 做冷库用什么网站发帖子好百度seo排名360
  • 制作一个网站怎么做的qq推广工具
  • 平凉哪家做企业网站全网模板建站系统
  • 手机钓鱼网站免费制作正安县网站seo优化排名
  • 哪个网站可以做纸箱网络营销的工具和方法
  • django做的网站如何运行北京网站seo
  • 全屏网站模板近期热点新闻
  • 汕头高端网站建设百度下载免费安装到桌面
  • asp本地网站无法打开如何创建一个网址
  • wordpress媒体库文件打不开湖南长沙seo
  • 用vs2013做网站教程qq推广链接生成
  • 哪个网站可以做免费商业推广友情链接seo
  • 网站开发与设计中学生成都网站seo厂家
  • 赣州网站建设平台环球资源网站网址
  • 地方门户网站运营搜狐酒业峰会
  • 玩具外贸网站模板网络营销顾问是做什么的
  • wordpress建站教程pdf百度关键词优化软件如何
  • 做软件网站电话百度
  • 常州市做网站的公司电商
  • 公司网站费怎么做分录网络推广怎么做
  • 帮别人做钓鱼网站 公安seo技术软件
  • 软件定制开发服务流程seo培训赚钱
  • 网站美工设计兰州seo公司
  • 自己建网站教程淘宝seo推广优化
  • 邯郸网站建设多少钱东莞寮步最新通知
  • 企业信息平台查询安卓优化清理大师
  • b站如何推广自己的作品百度搜索关键词排名优化推广