Code Monkey home page Code Monkey logo

vscode_c_win_scratch's Introduction

This sample template includes config for vs code to run c/cpp project using MS C/C++ compiler. Changes to default include compiling all cpp files in current folder and specifying an output exe name

** Must launch vs code in correct folder from the VS Developer Command prompt as it has all the paths to compiler etc configured **

Setup Steps

https://code.visualstudio.com/docs/cpp/config-msvc

1-Install C/C++ extension for VS Code 2 Create tasks.json : Terminal -> Configure Default Build Task - choose cl.exe build active file

3 Modify tasks.json Modify compiler config args to compile all cpp files, not just the currently active one ${file} => "${workspaceFolder}\*.c" ** change to *.c is necessary

Modify compiler config args to produce a certain output name
    "${fileDirname}\\${fileBasenameNoExtension}.exe"  => "${workspaceFolder}\\hello.exe",

5 Create launch.json : Run -> Add Configuration - choose C++ (Windows) Modify launch,json change program value from "${fileDirname}\${fileBasenameNoExtension}.exe", to "hello.exe", or whatever

Add a run precondition to compile project

** Must launch vs code in correct folder from the VS Developer Command prompt as it has all the paths to compiler etc configured **

vscode_c_win_scratch's People

Contributors

dannal avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.