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

java网站开发教程电子书贵阳百度推广电话

java网站开发教程电子书,贵阳百度推广电话,18年手机网站,怎么样找回网站密码提起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.tj-hxxt.cn/news/18604.html

相关文章:

  • 软文营销的三个层面安徽新站优化
  • 企业网站建站策划书品牌营销策略分析
  • 西安专用网站建设长沙网络推广
  • 外贸网站建设招聘2023年7月最新新闻摘抄
  • 东莞做网站哪家公司好百度seo课程
  • 销售网站开发背景地推团队接单平台
  • 建设百度网站郑州seo哪家好
  • 徐州哪有做网站的怎样在百度上发表文章
  • 管理咨询公司的运作模式北京seo优化分析
  • 大学学校网站建设方案seo推广平台服务
  • 高端网站建设报价百度推广登录入口下载
  • 网站建设怎么付费推广手段有哪些
  • 做网站就上凡科建设南昌百度搜索排名优化
  • 专业的上海网站建设百度助手app下载安装
  • 个人网站备案通过做淘客百度官方网页版
  • 东莞网站建设优化排名2022年搜索引擎优化指南
  • 网站开发与应用专业昆山网站建设推广
  • 郑州网站建设网络推广短信营销
  • 东莞网站建设招聘网站seo优化公司
  • 家具做网站培训机构是干什么的
  • 网站视频建设网站系统
  • dw中怎样做网站链接seo的基本步骤包括哪些
  • 电商网站建设任务分解结构互联网项目推广
  • 为了同学都能访问网站如何做热词搜索排行榜
  • 做房产买卖哪些网站可以获客个人网页怎么做
  • 企业网站seo诊断报告石家庄seo关键词排名
  • 域名买了怎么做网站西点培训
  • 设计网免费seo技术公司
  • 网站动态和静态的区别企业网站建设原则是
  • 石家庄网站建设蓝龙百度风云榜官网