DEV Community

dinhanhx
dinhanhx

Posted on

4 2

The way you should install C++ libraries and install Visual Studio on Windows 10

In this tutorial, I will show you the way to install Visual Studio as small as minimum as possible.

Install Visual Studio

Download Visual Studio Installer

When in Visual Studio Installer GUI windows, I suggest you tick like this

image

It will consume your diskspace at most 4gb.

Install vcpkg

vcpkg is a cross-platform C++ libraries manager. It will do the hard work for you such as building, importing, setting up PATHS, ..etc.

How to install vcpkg

To install vcpkg

> git clone https://github.com/microsoft/vcpkg
> .\vcpkg\bootstrap-vcpkg.bat
Enter fullscreen mode Exit fullscreen mode

To install the libraries for your project, run:

> .\vcpkg\vcpkg install [packages to install]
Enter fullscreen mode Exit fullscreen mode

You can also search for the libraries you need with the search subcommand:

> .\vcpkg\vcpkg search [search term]
Enter fullscreen mode Exit fullscreen mode

In order to use vcpkg with Visual Studio,
run the following command (may require administrator elevation):

> .\vcpkg\vcpkg integrate install
Enter fullscreen mode Exit fullscreen mode

All installed libraries are immediately ready to be #include'd and used in your project without additional configuration.

Example

I want to setup glut, glew, glm for my Computer Graphics course.

I go to where my vcpkg is installed. Then I run

vcpkg.exe install freeglut glew glm
Enter fullscreen mode Exit fullscreen mode

I wait until it is done.

vcpkg.exe integrate install
Enter fullscreen mode Exit fullscreen mode

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

Top comments (0)

Image of AssemblyAI

Automatic Speech Recognition with AssemblyAI

Experience near-human accuracy, low-latency performance, and advanced Speech AI capabilities with AssemblyAI's Speech-to-Text API. Sign up today and get $50 in API credit. No credit card required.

Try the API

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay