• 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
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23

    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相同
            }
    
        ]
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35

    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\""
            }
        ]
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
  • 相关阅读:
    你真的会使用 《断点》 吗
    STM32实现硬件I2C通讯,读取MPU6050的ID号
    [c++] 单例模式 + cyberrt TimingWheel 单例分析
    Ubuntu20.04环境下Baxter机器人开发环境搭建
    三维度:专业、展现与连接
    【Linux】权限管理
    大数据项目 --- 数据采集项目
    详细nginx配置websocket的wss协议
    做酒类行业应该如何推广自身品牌?
    详解三次握手与四次挥手及相关面试题回答
  • 原文地址:https://blog.csdn.net/qq_35662333/article/details/134032621