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

自己做一网站 多做宣传.建设视频网站需要什么知识

自己做一网站 多做宣传.,建设视频网站需要什么知识,网站和微信同步建设,游戏策划是做什么的提起Makefile,可能有人会觉得它已经过时了,毕竟现在有比它更好的工具,比如CMake,XMake,Meson等等,但是在Linux下很多C/C源码都是直接或者间接使用Makefile文件来编译项目的,可以说Makefile是基石…

提起Makefile,可能有人会觉得它已经过时了,毕竟现在有比它更好的工具,比如CMake,XMake,Meson等等,但是在Linux下很多C/C++源码都是直接或者间接使用Makefile文件来编译项目的,可以说Makefile是基石。

另外,针对C++ 20的一些特性,像比较流行的CMake工具,目前支持还不完善,如果想要尝鲜C++ 20的一些新特性,比如Module,目前最好是使用Makefile比较方便。后面笔者会专门介绍C++ 20的Module使用。

微软官方出了一个VSCode的Makefile Tools插件,用于编译、调试、运行C/C++程序。

笔者以一个简单的示例来介绍它。

如果是Windows,则需要安装MSYS2 MinGW,然后在Windows下配置PATH环境变量,包含MinGW64的gcc以及MSYS2的make路径,比如:
G:\msys64\mingw64\binG:\msys64\usr\bin

在工作区编写一个C++文件, main.cc

#include <stdio.h>int main(int argc, char*argv[]) {printf("测试\n");return 0;
}

再编写一个Makefile文件:

.PHONY: all cleanCC := gcc
CXX := g++
CFLAGS :=
CXXFLAGS := -gdwarf-4
Target := mainSRCS += $(wildcard *.cc)
OBJS := $(patsubst %.cc, %.o, ${SRCS})all: $(Target)$(Target): $(OBJS)$(CXX) $(CXXFLAGS) $(OBJS) -o $@%.o: %.cc$(CXX) $(CXXFLAGS) -c $? -o $@clean:rm -rf $(OBJS) $(Target)

在工作区编写的了Makefile后,VSCode输出窗口Makefile Tools会有一系列日志:

No current configuration is defined in the workspace state. Assuming 'Default'.
No target defined in the workspace state. Assuming 'Default'.
Dropping various extension output files at c:\Users\admin\AppData\Roaming\Code\User\workspaceStorage\9d677e46e192d47afa37529f2e89bbe9\ms-vscode.makefile-tools
Logging level: Normal
Configurations cached at c:\Users\admin\AppData\Roaming\Code\User\workspaceStorage\9d677e46e192d47afa37529f2e89bbe9\ms-vscode.makefile-tools\configurationCache.log
No path to the makefile is defined in the settings file.
No folder path to the makefile is defined in the settings file.
Always pre-configure: false
Always post-configure: false
Dry-run switches: '--always-make', '--keep-going', '--print-directory'
No current launch configuration is set in the workspace state.
Default launch configuration: MIMode = undefined,miDebuggerPath = undefined,stopAtEntry = undefined,symbolSearchPath = undefined
Configure on open: true
Configure on edit: true
Configure after command: true
Only .PHONY targets: false
Save before build or configure: true
Build before launch: true
Clear output before build: true
Ignore directory commands: true
compile_commands.json path: null
Deduced command 'make.exe ' for configuration "Default"
The Makefile Tools extension process of configuring your project is about to run 'make --dry-run' in order to parse the output for useful information. This is needed to calculate accurate IntelliSense and targets information. Although in general 'make --dry-run' only lists (without executing) the operations 'make' would do in the current context, it is still possible some code to be executed, like $(shell) syntax in the makefile or recursive invocations of the $(MAKE) variable.
If you don't feel comfortable allowing this configure process and 'make --dry-run' to be invoked by the extension, you can chose a recent full, clean, verbose and up-to-date build log as an alternative, via the setting 'makefile.buildLog'. 

并且会弹出对话框:

在这里插入图片描述

点“确定”即可。

此时Makefile面板如下:
在这里插入图片描述

我们需要设置生成目标启动目标,在其后点笔那个的图标按钮,则会弹出所有目标,生成目标如下,选择all

在这里插入图片描述

启动目标如下,只有一个,选择它:
在这里插入图片描述
设置好后,如下图:
在这里插入图片描述
右上边有三个按钮,分别是编译调试运行
需要注意的是编译是使用的VSCode的shell类型任务执行的,如果如解决Windows下VSCode控制台乱码问题中所述,添加了VSCode的控制台启动参数,则可能会失败,需要去掉参数再执行,结果如下:

在这里插入图片描述
调试按钮,VSCode会使用cppdbg引擎启动gdb进行调试,UTF8中文可以正常显示。
在这里插入图片描述

http://www.yayakq.cn/news/567970/

相关文章:

  • 龙岗汤坑社区网站建设国家开发银行网站
  • 网站后台登陆路径网络营销招聘岗位有哪些
  • 女性开源网站官方网站下载安装云支付
  • 电子商务网站设计与制作网站代码优化视频教程
  • 如何建立自己的微网站河南省百城建设提质工程网站
  • 怎么做招聘网站的调研关于wordpress更新时无法创建目录
  • 网页站点规划公司建设哪个方便
  • 做期货资讯网站ppt模板去哪个网站下载
  • 网站建设人文环境腾讯网页游戏排行榜
  • 有哪些做平面设计好的网站有哪些内容wordpress文章点赞
  • 中国联通网站备案管理系统软件培训机构学费多少
  • 武隆网站建设公司企业网站的推广方法有哪些
  • 宝安的医院网站建设二建考试查询入口
  • 北京商城网站开发网络营销ppt讲解
  • 网站开发第三方支付wordpress字符图标
  • 温州中小企业网站制作阳江问政平台投诉平台
  • 计算机协会网站模板哪些网站可以做网站
  • 做网站应该了解什么问题seo技巧是什么
  • 没有收款接口网站怎么做收款cdr平面设计教程
  • 个人网站备案方法制作网页的基本步骤
  • 网站seo优化推广科技有限公司简介
  • 网站优化搜索如何做百度网站2017
  • 非交互式网站可以做商城吗许昌网站制作公司
  • 企业高端网站建设美工化妆品网络营销策划书
  • 版式设计素材网站凡科抽奖
  • 上海建设网站找哪家怎么增加网站的流量
  • 商业网站建设常识做好网站建设
  • 网站诊断分析报告模板及优化执行方案.doc无锡网站建设选千客云网络
  • 自己如何建设网站首页网页设计基础的教学目的
  • 商务网站开发目的成都网站制作028net