vscode 配置第三方库 opengl 开发

c_cpp_properties.json

复制代码
{
    "configurations": [
        {
            "name": "Win32",
            "includePath": [
                "${workspaceFolder}/**",
                "D:\\Professional\\Third_Library\\3DGIS\\OpenGL\\freeglut\\include",
                "D:\\Professional\\Third_Library\\3DGIS\\OpenGL\\glew-2.1.0-win32\\glew-2.1.0\\include" //glew
            ],
            "defines": [
                "_DEBUG",
                "UNICODE",
                "_UNICODE"
            ],
            "windowsSdkVersion": "10.0.19041.0",
            "compilerPath": "C:/Program Files/MinGW/mingw64/bin/g++.exe",
            "cStandard": "c11",
            "cppStandard": "c++11",
            "intelliSenseMode": "gcc-x64"
        }
    ],
    "version": 4
}

launch.json

复制代码
{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "(gdb) 启动",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "C:\\Program Files\\MinGW\\mingw64\\bin\\gdb.exe",
            "setupCommands": [
                {
                    "description": "为 gdb 启用整齐打印",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "将反汇编风格设置为 Intel",
                    "text": "-gdb-set disassembly-flavor intel",
                    "ignoreFailures": true
                }
            ],
            "preLaunchTask": "C/C++: g++.exe 生成活动文件"    //与tasks.json中的label相同
        }

    ]
}

tasks.json

复制代码
{
	"version": "2.0.0",
	"tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: g++.exe 生成活动文件",
            "command": "C:\\Program Files\\MinGW\\mingw64\\bin\\g++.exe",
            "args": [
                "-D GLEW_STATIC", //因为我们链接的是静态库,使用该宏告知glew
                "-fdiagnostics-color=always",
                "-g",
                "${fileDirname}\\*.cpp",
                "D:\\Professional\\Third_Library\\3DGIS\\OpenGL\\freeglut\\lib\\x64\\libfreeglut.a", //链接至freeglut库
                "D:\\Professional\\Third_Library\\3DGIS\\OpenGL\\glew-2.1.0-win32\\glew-2.1.0\\lib\\Release\\x64\\glew32s.lib", //链接至glew静态库
                "-lopengl32", //链接系统中的opengl32库
                "-lgdi32", //链接系统中的gdi32库
                "-o",
                "${fileDirname}\\${fileBasenameNoExtension}.exe",
                "--include-directory=D:\\Professional\\Third_Library\\3DGIS\\OpenGL\\freeglut\\include", //确保头文件的包含
                "--include-directory=D:\\Professional\\Third_Library\\3DGIS\\OpenGL\\glew-2.1.0-win32\\glew-2.1.0\\include" //确保头文件的包含
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "test",
                "isDefault": true
            },
            "detail": "编译器: \"C:\\Program Files\\MinGW\\mingw64\\bin\\g++.exe\""
        }
    ]
}
相关推荐
bkspiderx10 小时前
在Visual Studio中安装与配置Qt插件(Qt Visual Studio Tools)
ide·qt·visual studio·qt插件
lusklusklusk1 天前
使用Visual Studio一步步创建并部署SSRS_PBIRS报表:数据源配置、图表设计、参数化查询、部署参数与排错实战
数据库·ide·visual studio
解道Jdon1 天前
Rust重写OpenCode Rune:性能提升最高100倍
ide·windows·git·svn·eclipse·github·visual studio
莫卢俊德1 天前
vscode ssh config
ide·vscode·ssh
郝学胜-神的一滴3 天前
Effective Python 条款44:善用属性注解
开发语言·c++·vscode·python·算法·stl
BD_Marathon6 天前
安装Jupyter notebook
ide·python·jupyter
讓丄帝愛伱7 天前
Zed Markdown 预览不能铺满全屏的原因及解决
ide
FungLeo7 天前
FengCMS · PHP+MySQL 升级实录 · 编辑器迁移:KindEditor → wangEditor5 +服务端 HTML Purifier
mysql·编辑器·php·富文本编辑器·fengcms
BD_Marathon8 天前
Jupyter魔法命令
ide·python·jupyter
郝学胜-神的一滴8 天前
Effective STL 条款 07:指针容器销毁前先删除
开发语言·c++·vscode·leetcode·rpc·visual studio