如何在VScode中运行processing

processing自带的IDE用起来十分难受,能不能用Vscode写processing呢?


  • 首先需要先安装processing,在
    processing官网左侧Download免费可以下载各种版本

  • 在Vscode扩展直接搜索processing下载第一个插件
    在这里插入图片描述

  • 在插件介绍中可以看到,需要先在processing的“工具”中安装“proceesing-java”(win有些许差异)
    在这里插入图片描述

  • 然后在processing工程的目录里创建.vscode/tasks.json

把里面的内容替换为:

{
	"version": "2.0.0",
	"tasks": [
	  {
		"label": "Run Sketch",
		"type": "shell",
		"group": {
		  "kind": "build",
		  "isDefault": true
		},
		"command": "${config:processing.path}",
		"presentation": {
		  "echo": true,
		  "reveal": "always",
		  "focus": false,
		  "panel": "dedicated"
		},
		"args": [
		  "--force",
		  "--sketch=${workspaceRoot}",
		  "--output=${workspaceRoot}/out",
		  "--run"
		],
		"windows": {
		  "args": [
			"--force",
			"--sketch=${workspaceRoot}",
			"--output=${workspaceRoot}\\out",
			"--run"
		  ]
		}
	  }
	]
  }

注意!!!processing工程 的目录,而非processing安装目录,我第一次在安装目录下创建了.vscode/tasks.json以为能一劳永逸,结果跟我说找不到名为“processing”的文件……折腾了老半天
在这里插入图片描述
也就是说 在每一个processing项目中 都需要加一个task.json 然后才能在vscode中运行 ,不知道是我的打开方式不对还是本身就得这样,有知道的小伙伴可以评论或者私信指出

  • 另:Vscode中的自动补全功能好用,在新建立一个文件时直接打出setup 然后将光标下移选择第一个就可以直接生成模板,非常方便在这里插入图片描述
    在这里插入图片描述

PS:Vscode直接运行工程速度有点慢,好在Vscode的自动保存功能,可以在processing打开这个工程的状态下,先在Vscode编辑,然后返回到processing运行,貌似会快那么一点


参考

https://blog.csdn.net/vaskka/article/details/102686756

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
在VS Code安装dlib需要先安装CMake和Boost库,然后才能安装dlib。以下是具体步骤: 1. 安装CMake: 在官网下载CMake安装包并安装,或者在终端使用命令安装: ``` sudo apt-get install cmake ``` 2. 安装Boost库: 在终端使用命令安装Boost库: ``` sudo apt-get install libboost-all-dev ``` 3. 在VS Code安装C/C++插件: 打开VS Code,点击左侧的“Extensions”按钮,搜索“C/C++”插件并安装。 4. 创建一个C++项目: 在VS Code创建一个C++项目,例如创建一个名为“test”的文件夹,并在文件夹创建一个名为“main.cpp”的文件。 5. 编写代码: 在“main.cpp”文件编写dlib代码,例如: ``` #include <dlib/image_processing/frontal_face_detector.h> #include <dlib/image_processing.h> #include <dlib/gui_widgets.h> #include <dlib/image_io.h> using namespace dlib; int main() { frontal_face_detector detector = get_frontal_face_detector(); image_window win; // Load an image file into our image object. array2d<unsigned char> img; load_image(img, "test.jpg"); // Now tell the face detector to give us a list of bounding boxes // around all the faces it can find in the image. std::vector<rectangle> dets = detector(img); // Now we show the image on the screen and the face detections as // red overlay boxes. win.clear_overlay(); win.set_image(img); win.add_overlay(dets, rgb_pixel(255,0,0)); // Wait until the user hits enter to close the window. std::cin.get(); } ``` 6. 配置CMakeLists.txt文件: 在项目文件夹创建一个名为“CMakeLists.txt”的文件,并在其添加以下内容: ``` cmake_minimum_required(VERSION 3.0) project(test) find_package(dlib REQUIRED) add_executable(test main.cpp) target_link_libraries(test dlib::dlib) ``` 7. 编译项目: 在终端进入项目文件夹,运行以下命令编译项目: ``` mkdir build cd build cmake .. make ``` 8. 运行程序: 在终端进入“build”文件夹,运行以下命令运行程序: ``` ./test ```
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值