Skip to content

Instantly share code, notes, and snippets.

@brunorozendo
Last active April 10, 2020 14:37
Show Gist options
  • Save brunorozendo/bd5d7ff8ec8c4da79aaed4e9acb962d3 to your computer and use it in GitHub Desktop.
Save brunorozendo/bd5d7ff8ec8c4da79aaed4e9acb962d3 to your computer and use it in GitHub Desktop.
C && C++ compiler windows

Google

install c++ compiler build tools windows MSVC

Abrir página "Use the Microsoft C++ toolset from the command line" https://docs.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=vs-2019

If you only want the command-line toolset, download the "Build Tools for Visual Studio" Fazer download do aquivo "vs_BuildTools.exe"

Excutar vs_BuildTools.exe

workloads > Desktop && Mobile > marcar "C++ build tools" e instalar

Criar projeto: buidl/ CMakeLists.txt

cmake_minimum_required(VERSION 3.17.0-rc1)

project(projeto C)

set (CMAKE_C_STANDARD 17)

add_executable(ex1 ex1.c)
add_executable(ex2 ex2.c)
add_executable(ex3 ex3.c)

ex1.c

Executar projeto

build> cmake -S .. -B . && cmake --build . --config
build> .\Debug\teste1.exe
build>  cmake -G "Visual Studio 16 2019" -A x64 -S .. -B .
build> cmake --build . --config Debug
Menu Iniciar > Developer Command Prompt for VS 2019
cd <pasta>
cl ex1.c
ex1.exe
 
 
   
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment