search
HomeDevelopment ToolsVSCodeTake you step by step to configure Geant4 and Root in VSCode

This article is a VSCode configuration article. It will teach you step by step how to configure and use Geant4 and Root in VSCode. I hope it will be helpful to everyone!

Take you step by step to configure Geant4 and Root in VSCode

For a long time, I have always preferred Visual Studio as an IDE for C development. From version 08 to the currently commonly used version 19, I have not chosen it for a long time. Changed. Are there any other IDEs to choose from? Of course there are! This article will guide you step by step through VS Code configuration to compile, run, and debug Geant4 and Root. [Recommended learning: "vscode introductory tutorial"]

Development environment configuration

System environment

Virtualization platform: VMware WorkStation 16 Pro

Take you step by step to configure Geant4 and Root in VSCode

Operating system: Ubuntu 16.04 LTS

Take you step by step to configure Geant4 and Root in VSCode

Installation

Enter VS Code Official website or 中文网, select the version suitable for the system and download it , here I choose the Linux version.

Take you step by step to configure Geant4 and Root in VSCode

After the download is completed, it is a brainless installation. The operation is as fierce as a tiger. After the installation is completed, the first time you enter the page is as shown below. Select your favorite theme and what you want. function.

Take you step by step to configure Geant4 and Root in VSCode

Add C-related plug-ins

Search and add C-related plug-ins on the extension options, including Cmake Compilation tools.

Take you step by step to configure Geant4 and Root in VSCode

Add Geant4 and Root external dependencies

Before adding dependencies, create a new directory ( I randomly named it Root_First) as a workspace and open this directory through VS Code.

Then show All Command through the Ctrl Shift P key combination, and then select C/C edit configuration

Take you step by step to configure Geant4 and Root in VSCode

At this time, a hidden file c_cpp_properties.json will be automatically generated and placed in the .vscode directory.

Take you step by step to configure Geant4 and Root in VSCode

Next we introduce the dependencies of Geant4 and Root by modifying the c_cpp_properties.json file.

{
    "configurations": [
        {
            "name": "Linux",
            "browse":{
                "path":[
                    "${workspaceFolder}/src",
                    "${workspaceFolder}/include",
                    "/home/ll/root/include",
                    "/home/ll/geant4.10.04/include/Geant4"
                ],
                "limitSymbolsToIncludedHeaders":true
            },
            "includePath":[
                    "${workspaceFolder}/src",
                    "${workspaceFolder}/include",
                    "/home/ll/root/include",
                    "/home/ll/geant4.10.04/include/Geant4"
            ],
            "defines": [],
            "compilerPath": "/usr/bin/gcc",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "linux-gcc-x64"
        }
    ],
    "version": 4
}

A brief explanation:

  • ${workspaceFolder}/src Link src
  • ${workspaceFolder}/include Link include
  • /home/ll/root/include Link root
  • /home/ll/geant4.10.04/include/Geant4 Link geant4

At this point, the configuration of the external link library has been completed, the relevant dependencies will not be marked red and errors will be reported, and you can also use the class object pointer to remind you of some options and syntax checks when calling methods. and other functions.

Take you step by step to configure Geant4 and Root in VSCode

Friendly reminder: Remember to copy this configuration to the .vscode directory in every working directory in the future to take effect (if there is no .vscode directory , then you might as well create a new one).

For more knowledge about VSCode, please visit: vscode tutorial! !

The above is the detailed content of Take you step by step to configure Geant4 and Root in VSCode. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:掘金社区. If there is any infringement, please contact admin@php.cn delete
Visual Studio Professional and Enterprise: Paid Versions and FeaturesVisual Studio Professional and Enterprise: Paid Versions and FeaturesMay 10, 2025 am 12:20 AM

The difference between VisualStudioProfessional and Enterprise is in the functionality and target user groups. The Professional version is suitable for professional developers and provides functions such as code analysis; the Enterprise version is for large teams and has added advanced tools such as test management.

Choosing Between Visual Studio and VS Code: The Right Tool for YouChoosing Between Visual Studio and VS Code: The Right Tool for YouMay 09, 2025 am 12:21 AM

VisualStudio is suitable for large projects, VSCode is suitable for projects of all sizes. 1. VisualStudio provides comprehensive IDE functions, supports multiple languages, integrated debugging and testing tools. 2.VSCode is a lightweight editor that supports multiple languages ​​through extension, has a simple interface and fast startup.

Visual Studio: A Powerful Tool for DevelopersVisual Studio: A Powerful Tool for DevelopersMay 08, 2025 am 12:19 AM

VisualStudio is a powerful IDE developed by Microsoft, supporting multiple programming languages ​​and platforms. Its core advantages include: 1. Intelligent code prompts and debugging functions, 2. Integrated development, debugging, testing and version control, 3. Extended functions through plug-ins, 4. Provide performance optimization and best practice tools to help developers improve efficiency and code quality.

Visual Studio vs. VS Code: Pricing, Licensing, and AvailabilityVisual Studio vs. VS Code: Pricing, Licensing, and AvailabilityMay 07, 2025 am 12:11 AM

The differences in pricing, licensing and availability of VisualStudio and VSCode are as follows: 1. Pricing: VSCode is completely free, while VisualStudio offers free community and paid enterprise versions. 2. License: VSCode uses a flexible MIT license, and the license of VisualStudio varies according to the version. 3. Usability: VSCode is supported across platforms, while VisualStudio performs best on Windows.

Visual Studio: From Code to ProductionVisual Studio: From Code to ProductionMay 06, 2025 am 12:10 AM

VisualStudio supports the entire process from code writing to production deployment. 1) Code writing: Provides intelligent code completion and reconstruction functions. 2) Debugging and testing: Integrate powerful debugging tools and unit testing framework. 3) Version control: seamlessly integrate with Git to simplify code management. 4) Deployment and Release: Supports multiple deployment options to simplify the application release process.

Visual Studio: A Look at the Licensing LandscapeVisual Studio: A Look at the Licensing LandscapeMay 05, 2025 am 12:17 AM

VisualStudio offers three license types: Community, Professional and Enterprise. The Community Edition is free, suitable for individual developers and small teams; the Professional Edition is annually subscribed, suitable for professional developers who need more functions; the Enterprise Edition is the highest price, suitable for large teams and enterprises. When selecting a license, project size, budget and teamwork needs should be considered.

The Ultimate Showdown: Visual Studio vs. VS CodeThe Ultimate Showdown: Visual Studio vs. VS CodeMay 04, 2025 am 12:01 AM

VisualStudio is suitable for large-scale project development, while VSCode is suitable for projects of all sizes. 1. VisualStudio provides comprehensive development tools, such as integrated debugger, version control and testing tools. 2.VSCode is known for its scalability, cross-platform and fast launch, and is suitable for fast editing and small project development.

Visual Studio vs. VS Code: Comparing the Two IDEsVisual Studio vs. VS Code: Comparing the Two IDEsMay 03, 2025 am 12:04 AM

VisualStudio is suitable for large projects and Windows development, while VSCode is suitable for cross-platform and small projects. 1. VisualStudio provides a full-featured IDE, supports .NET framework and powerful debugging tools. 2.VSCode is a lightweight editor that emphasizes flexibility and extensibility, and is suitable for various development scenarios.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool