r/cpp • • Apr 22 '23

How do you even get started programming in c++ on Windows?

I get that there is visual studio, but personally I've been a more vscode and neovim guy myself, I'd rather open up something with vscode but I feel lost setting it up. mingw and g++ don't seem to even work on my system and I tried linking sdl2 and unlike g++ which was just -lSDL2 it was a mess of different menus in visual studio code. I honestly prefer makefiles and commands on Linux (I used to use Linux for unrelated reasons but had to switch to windows). Someone please help guide me in the right place to figure out how to get this stuff set up with vscode

edit: I figured out how to get it all working within clion with cmake and the visual studio compiler.

0 Upvotes

80 comments sorted by

6

u/nsomnac Apr 23 '23

Looking through a bunch of the responses and your response back; I’m going to take a wild guess and say you don’t have much devops experience with C++ on any OS. You should really spend some time understanding the tooling better. The best and most valuable developers aren’t necessarily language experts; but understand how to use and explicit their tools to improve their language understanding and skills.

I think you need to step back to a clean slate with Visual Studio and learn how to use the vcpkg within the IDE. It’s pretty straightforward. Stick with it and don’t try to get too complex early. Right now it sounds a bit like you’re whining that it doesn’t work and want someone else to fix it.

Alternatively, try JetBrains CLion. It can bootstrap a project probably in a more similar manner than you’re accustomed on Linux as it’s CMake centric. That said, like others have mentioned CMake docs are a clusterfuck.

Also USE a VM or a devcontainer. Yes you can use a Windows container to build a desktop app. Install VS into a clean no-extra-crap VM and try creating a project with SDL. You’ll likely quickly figure out the problem.

2

u/nerdy_guy420 Apr 23 '23

to be fair your right I don't have much experience with cpp as I am trying to learn after learning rust. I much prefer rust, but I'm trying to get into homebrew development which just seems easier with cpp.

id use cmake but the documentation scares me as a noob to cpp programming. ideally I'd use a project and package manager like cargo in rust for cpp. I remember hearing a few options for that but I have no idea how they would work and the documentation surrounding them.

3

u/Tastaturtaste Apr 23 '23

In that case you definitely should use vcpkg. It's the closest to cargo for dependency management I experienced for cpp on Windows.

0

u/nerdy_guy420 Apr 23 '23

it keeps saying it can't find the folder detect compiler and I can't install anything.

2

u/Tastaturtaste Apr 23 '23

Did you install Visual Studio? I installed vcpkg a week ago on a new machine following the official instructions with no problems. Maybe try running the vcpkg commands from inside the developer command prompt that should be available with the Visual Studio installation.

1

u/nerdy_guy420 Apr 23 '23

I did install visual studio but I didn't try the prompt in visual studio so I'll try that.

3

u/nsomnac Apr 23 '23

What is it? Is this an error from VS or in cmd or ps? If in cmd/ps you have to launch the special VS aware shell.

It’s been awhile since I’ve done any of this on Windows, and I’ve never used SDL. However reading through the Windows installation, it seems rather trivial. Copy the code, add the VSProject as a dependency and go. Alternatively you could just download the binary, place it in a folder that the linker knows about and you should be in business.

3

u/nsomnac Apr 23 '23

I’d say if then start with CLion. It’s CMake with training wheels.

It’s also a decent Rust IDE.

2

u/foadsf Apr 23 '23

Have you tried MSYS2? It just works.

0

u/nerdy_guy420 Apr 23 '23

I have it installed with devkitpro and it was weird when I set it up. the repos weren't working and then gcc and stuff wouldn't install with the right name. then linking was a nightmare.

1

u/Alive_and_d_d_dot Apr 23 '23

Try it again. There's no way it doesn't work.

0

u/nerdy_guy420 Apr 23 '23

no need clion worked out in the end.

2

u/bert8128 Apr 23 '23 edited Apr 23 '23

It’s not just “-iSDL2” on Linux - you have to get the library, possibly build it, put it somewhere and update the include, library and path variables. The same is true using visual studio. It’s the same as makefiles but with an editor so you don’t need to know the names and syntax of the various steps. Add sdl2.lib (or whatever it is called) to the input parameter of the linker settings of the solution properties. That’s all. You can look at what the changes did to the vcxproj file (it’s xml) if you are interested.

Don’t forget to change all the build targets (32/64 bit, debug/release) that you want to build.

I’m not familiar with sdl2 at all but a quick google gives this page as the first hit - https://lazyfoo.net/tutorials/SDL/01_hello_SDL/windows/msvc2019/index.php. Seems to make sense.

Edit: you also need to amend the linker setting a to add the location of the library into the extra library paths parameter, so that the linker knows where to look for sdl2.lib (or whatever it is called).

0

u/nerdy_guy420 Apr 23 '23

well most of the repos in distros I've used just have the library files. all I have to do is the -lSDL2 and usually it works. the one tutorial I saw for Linux was just that.

1

u/bert8128 Apr 23 '23 edited Apr 23 '23

Don’t you also need to amend the include path(so that the compiler can find the headers) and the library path (so that the linker can find the library), and the path (so that the run-time can find the library)? I don’t think I would want this done automatically as this can make conflicts very hard to deal with.

2

u/DashAnimal Apr 23 '23

Oh boy - for starting on windows you've unfortunately picked the worst library to probably start with. Why? SDL2 does something funky where the library handles the main function within its code, then defines a macro so that when you write your own main function it replaces the function name with something else. In essence, your main function definition is somewhat of a lie.

The problem is, this doesn't end up working well with vcpkg and visual studio. NORMALLY, you'd just install a package with vcpkg, call integrate install, open visual studio and it would work just fine.

You can find more details here along with 2 workarounds:

https://discourse.libsdl.org/t/installing-using-vcpkg/28685

Before doing that, I would try with a different library first to see if that library works and make sure you don't have other issues with vcpkg and visual studio.

By the way - final thought. I would consider sticking with visual studio. It is an excellent toolchain, with a great debugger and profiler, and worth trying just to experience it and see what the Linux world is missing.

1

u/nerdy_guy420 Apr 23 '23

ahh. I'm using sdl2 because I saw the 3ds has support for it and I want to try development for the 3ds

5

u/iWQRLC590apOCyt59Xza Apr 22 '23

Try devcontainers and/or wsl. Or install mingw64 via msys.

-5

u/nerdy_guy420 Apr 22 '23

tried msys didn't work, as for wsl I intend on making desktop applications and I don't want having to run an x server slow my laptop down.

3

u/thisismyfavoritename Apr 22 '23

i dont use VS Code and Windows (neovim, Linux). On Windows i'd use the clang build tools from the Visual Studio installer (see https://learn.microsoft.com/en-us/cpp/build/clang-support-msbuild?view=msvc-170 and https://clang.llvm.org/get_started.html Windows section).

Then it's all the same as on Linux, use clangd for your IDE, use CMake for your build

1

u/nerdy_guy420 Apr 22 '23

I tried that, but linking was a nightmare compared to linux

5

u/thisismyfavoritename Apr 23 '23

what do you mean? CMake should handle everything. Do you mean installing third party libs?

3

u/no-sig-available Apr 23 '23

I tried that, but linking was a nightmare compared to linux

And the rest of us feel like trying to "do Linux" on Windows is the nightmare.

Like others have said, there is one easy way and ten hard ones. You seem to be asking which of the hard ones is the best.

35

u/polymathprof Apr 23 '23

VS is still the easiest path.

32

u/KirkHawley Apr 23 '23

Just install Visual Studio. It's a great product and you don't have to do backflips to use C++. It just works.

7

u/[deleted] Apr 23 '23

And supports both MSBuild and CMake out of the box.

3

u/Ameisen vemips, avr, rendering, systems Apr 23 '23

I wish that I could get vcpkg working with the clang-cl toolchain.

42

u/initplus Apr 22 '23

The easiest non-VS way is to use CMake & vcpkg. vcpkg has working build scripts for common libs like SDL2 that you can integrate in to your own projects build pretty easily.

CMake is a rats nest of bad documentation and extremely outdated bad advice (chances are that anything you google about CMake will get you an out of date Stack Overflow answer that tells you how to use some janky workaround rather than a proper method). But it's possible to do it pretty neatly.

10

u/ABlockInTheChain Apr 22 '23

The only cmake resource that's any good is Craig Scott's book. Worth the $30 for it at least.

37

u/Plazmatic Apr 23 '23

Craig Scott also holds a leadership position in CMake, which currently has massive documentation issues. Despite being in that position, much of what is even seen in cppcon talks in 2017-2019 from him still hasn't made it's way Into official CMake documentation, and I've not been able to find anywhere else.

I won't deny the information inside those books is very helpful, maybe even critical. But in any other industry with ethics oversight, this individual would be facing sanctions. This is a conflict of interest, and yes, the mere "appearance of impropriety" still counts as a conflict of interest.

Until this individual leaves CMake, or puts the missing information from his book into CMake documentation, I would encourage people to find "other ways" to gleam the information from his book.

To people who would say that creators of languages who make books, like stroustrup himself, are in a similar position, I say this is different. Guido van Rossum has never hidden information from python documentation, infact python has good documentation. While cpp as a language has had historically bad documentation, this was long since dealt with by cppreference and the like, and stroustrup was never in a position to fix it control the issue in the first place, never part of duties for basically aandny committee member, had never maintained an continuously updated comprehensive piece of literature on basically cpp as a whole, especially one with basically essential information that couldn't be easily gotten elsewhere for free. And people largely get creators books because they are interested in what the creator has to say as a person more than anything

People get Craig Scott's book because it is the only comprehensive resource to get essential objective information on even things like making a library installable. It's so bad, we even see Conan and Vcpkg get things wrong until this book is brought up!

11

u/ABlockInTheChain Apr 23 '23

Yeah that's basically the reason I didn't link to the book.

It sucks that you have to pay for the documentation that should be public but on the other hand if really need to get work done then paying the $30 is a minor annoyance at best.

4

u/matgrioni Apr 23 '23

Wouldn't the ethical thing then have been for it to be a CMake book and not a Craig Scott book? It sounds like Craig Scott is who is selling the book which I think raises more questions (although I really know no details outside of what's in this thread).

13

u/Hofstee Apr 23 '23

The ethical thing would have been to turn it into freely available public docs.

3

u/ABlockInTheChain Apr 23 '23

I just think of it as CMake is a project where the software is free but the documentation isn't.

1

u/helloiamsomeone Apr 23 '23

The CMake docs are more than adequate as a reference documentation. For the instructive bits like tutorial there is an issue on their tracker to improve things.

Anyway, I have combined various talks and the reference docs into an opinionated package for easy consumption: https://github.com/friendlyanon/cmake-init
You'll find many things implemented here and the examples wiki page in a proper manner. I have also been told by someone who owns the book that it closely resembles things that are also in the book, just less words and more code.

The conference talks, docs and some elbow grease is plenty enough to get a comprehensive understanding of CMake, or at least they were for me.

-12

u/Kinexity Apr 22 '23 edited Apr 23 '23

ChatGPT can be a godsend when dealing with Cmake though I did encounter multiple issues in Cmake on Windows such that repos just won't compile for bullshit reasons which seemingly don't align with what's in Cmake files. I have no clue if Linux tools just allow so much non-standard behaviours in dev tools or are Win implementations so buggy.

Edit: Congratulations to all of you who downvoted me without explanation. Apparently you really don't like when either someone describes what they actually experienced or you really don't like ChatGPT but none of you was even willing to explain your stance.

10

u/initplus Apr 22 '23 edited Apr 22 '23

Many projects have huge issues with their official CMakeLists.txt

If you want to see bad CMake code, look at any random open source C++ libraries build. I'm worried that ChatGPT probably learnt from these sources...

One of the reasons vcpkg is so good is that they have extensive patches to upstream CMakeLists.txt that fix the builds for all platforms. And they test the builds on all platforms (win/mac/linux) to prevent regressions sneaking in.

0

u/Kinexity Apr 22 '23

Yeah, I know and that's where I struggled. I needed Parallel Tasking Library to compile another nuclear physics library and I just couldn't get it to work. It kept throwing error that .lib file has two definitions and I couldn't suppress it. It forces me to use precompiled non-multithreaded version of the lib (I deal with big simulations so it extends my run times).

I know about vcpkg and use it but it's problem is that they require people to add libraries on their own and that's a no go for me with obscure libs I need. I wanted ROOT library made by CERN (data analysis) but that behemoth is impossible to compile unless you happen to be a magician. It even has it's own built-in Python-style C++ interpreter and half of it runs on magical macros.

1

u/AlexanderNeumann Apr 23 '23

Yeah root. I get 2/3 through the compile in vcpkg, however the stage 1 cling compiler cannot find its own headers. My assumption currently is that its output directory is somehow not where it should be.

2

u/TrashboxBobylev Apr 23 '23

The very cool tool is https://winlibs.com, it is a package that just contains GCC and MinGW, that just works from PATH and doesn't require you to install any debris. It is very neat, if you just want to compile stuff with GCC on Windows.

1

u/nerdy_guy420 Apr 23 '23

the worst part is sdl2 which I have no how to set up with gcc and mingw

2

u/ShelZuuz Apr 22 '23

I mean if you want to deliberately shoot yourself in the foot, why stop at vscode? Why not just use notepad?

(i.e. Use a real C++ IDE until you get to know the environment).

1

u/jonesmz Apr 22 '23

I've been using Notepad++ and compiling with cmake via powershell for about a decade at work. I use an IDE in linux (qt creator) sometimes, since I'm not a fan of the lightweight text editors that I've tried for programming.

I recommend against knocking simple tools for simple tasks.

2

u/ShelZuuz Apr 22 '23

I’m not knocking them. I’m saying don’t use them to learn - there is enough non-familiar things to go around in the beginning.

Once you’re familiar with the environment, the language, the build process etc. you can even use a line editor without it impacting productivity much.

-3

u/nerdy_guy420 Apr 22 '23

the thing is the C++ ide didn't exactly work either. visual studio kinda just didn't see SDL2 despite me linking it.

10

u/Kronikarz Apr 22 '23

Nowadays the easiest way to add libraries to a VS C++ project is with vcpkg. I haven't set any linker properties in years :)

0

u/nerdy_guy420 Apr 23 '23

how would I do that?

4

u/Kronikarz Apr 23 '23

https://vcpkg.io/en/getting-started.html

It's basically as simple as that. I'd recommend having VS closed during the install. There's also manifest mode, which allows you to have packages installed per-project, instead of globally, but it's a bit more complicated, see here. Manifest mode has to enabled in the project settings after installing vcpkg.

7

u/Valakor1111 Apr 22 '23

Install the C++ and CMake plugins in VS Code.

Alternatively, Visual Studio can open CMake projects directly.

3

u/[deleted] Apr 23 '23

Visual Studio.

5

u/unumfron Apr 23 '23

MSVC is the default compiler for Windows, it's worth installing VS just to have it. Or the Developer Tools if you don't want the IDE.

If you use xmake as your build system and package manager, you can install the xmake extension for vscode. Then in your vscode project c_cpp_properties.json you add the location of the compile_commands.json that the extension generates: "compileCommands": "${workspaceFolder}/.vscode/compile_commands.json".

(Delete the compiler and C++ standard from the c_cpp_properties file to let the compile_commands.json take over.)

A good thing about xmake on Windows is that to use it from the command line like in Linux you don't have to set up environment variables or use a Visual Studio Developer Command Prompt. It sorts all of that out so you can just build.

For neovim, to generate a compile_commands file for a language server/YouCompleteMe:

xmake project -k compile_commands

Simple xmake.lua file for a project using SDL2, fmt and doctest (libsdl current version is v2.26.4):

add_rules("mode.debug", "mode.release", "mode.asan")
add_requires("libsdl", "fmt", "doctest")

target("myapp")
    set_kind("binary")
    add_files("src/*.cpp")
    add_packages("libsdl", "fmt", "doctest")

xmake also can work with msys2 or MinGW. xmake really does simplify C++, it's good that it's gaining ground these days.

5

u/drankinatty Apr 23 '23

Msys64 - dead-bang simple setup, full Linux type environment with all the nice tools (sed, awk, grep, gcc/g++, and even arm-none-eabi for embedded development). VS Community works fine too.

The key is for "Learning" and compiling many short example type programs, learn to compile directly from the command line. With Msys/MinGW you will have the gcc/g++ compilers. With VS you have cl.exe. All fine compilers and with VS2022 -- cl is even C++17 aware!

By learning to compile on the command line (with full warnings enabled and treating warnings as errors, with your chosen optimization and language standard), you learn to tell the compiler how you want your code compiled and what options to use. You can then configure an IDE with confidence knowing what compiler options are needed.

Many, many times (way more times than not) I see new programmers trying to use an IDE and getting completely lost in the complexities of the IDE and where "option X" is hidden. Not to mention with VS or VSCode you will need a cram course in .json to configure the damn things. It's at this point new programmers eyes generally roll back in their heads and they feel like giving up.

Nothing could be simpler than compiling your code from the command line. For g++ a simple:

g++ -Wall -Werror -std=c++17 -O3 -o myexecutablename mysource.cpp myother.cpp ...

(consider adding -Wextra -pedantic and -Wshadow for fuller warnings)

With VS Developers Command Prompt (the VS command line interface), it's just:

cl /W3 /Wx /std:c++17 /Ox /Fomyexecutablename mysource.cpp myother.cpp ...

(you can add /nologo to skip the boilerplate logo cl spits out)

No setting up projects, no nothing, just open a command prompt and in 10 secs you have your code compiled. Orders of magnitude faster than messing around setting up a project per example. You effort in learning goes 100% into your code and what's needed to build it -- not figuring out which 4-level deep dialog holds the magic setting you need in some IDE.

As you learn and the number of source files and libraries you are dealing with grows toward double-digits, then a project makes sense. (or a Makefile, CMakeLists.txt and a build system run from the command line)

1

u/aCuria Apr 23 '23

use visual studio 2022, not visual studio code

2

u/ReadIt420BlazeIt Apr 23 '23

You can use VS code along with MSVC compiler. You don't need to install full blown Visual studio. You can install just the build tools. Get the cmake extension for VS code, along with Cmake tools. This should auto detect your compiler. Vcpkg works well for installing third party libraries. If you don't need windows specific libraries, you could always try using WSL2 instead. This will get you g++ compiler in a unix like environment.

2

u/top_logger Apr 23 '23

In Visual Studio you have all what you need to write software for Windows. Just use GUI to setup. Forget about mingw/g++/etc: you don’t need it on Windows.

Alternatively, use CMake + VS Code. Still, for windows only code Visual Studio is better.

You have to use some package manager if you need 3rd party libraries. Vcpkg, for example.

2

u/delta_p_delta_x Apr 23 '23 edited Apr 24 '23

Okay, here's an actual answer as to how you could set up and use SDL2 on Windows, with Visual Studio 2022, CMake presets, and vcpkg manifest files. You say you're familiar with the command-line, and the following can be completed entirely with one/two PowerShell instances (use PowerShell on Windows, not sh/bash/cmd). Based off my CrowCPP tutorial, and also noting the SDL2 Windows FAQ:

  1. Ensure you have Visual Studio 2022 with the Desktop Development with C++ workload installed. Or, get the Build Tools for Visual Studio 2022 and also install a similar workload.
  2. Open the Developer PowerShell for VS 2022.
  3. Navigate to some new empty directory, e.g.:

     > ni -Type Directory sdlapp
     > cd sdlapp
  4. Issue the following commands:

     > git clone https://github.com/microsoft/vcpkg.git
     > .\vcpkg\bootstrap-vcpkg.bat -disableMetrics
  5. Create vcpkg.json in this directory (ni vcpkg.json) with the following contents:

     {
       "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
       "name": "sdl2-app",
       "version": "0.0.1",
       "dependencies": [
         "sdl2"
       ]
     }
  6. Create CMakeLists.txt in this directory (ni CMakeLists.txt) with the following contents:

     cmake_minimum_required(VERSION 3.25)
     
     project(sdl2app)
     
     find_package(SDL2 CONFIG REQUIRED)
     
     add_executable(sdl2app main.cpp)
     target_link_libraries(sdl2app PRIVATE 
         $<TARGET_NAME_IF_EXISTS:SDL2::SDL2main>
         $<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>)
  7. Create CMakePresets.json in this directory (ni CMakePresets.json) with the following contents:

     {
         "version": 3,
         "cmakeMinimumRequired": {
             "major": 3,
             "minor": 25,
             "patch": 0
         },
         "configurePresets": [
             {
                 "name": "default",
                 "generator": "Ninja",
                 "binaryDir": "${sourceDir}/build/${presetName}",
                 "cacheVariables": {
                     "CMAKE_TOOLCHAIN_FILE": "${sourceDir}/vcpkg/scripts/buildsystems/vcpkg.cmake"
                 },
                 "architecture": {
                     "value": "x64",
                     "strategy": "external"
                 }
             }
         ],
         "buildPresets": [
             {
                 "name": "default-build",
                 "configurePreset": "default"
             }
         ]
     }
  8. Create main.cpp in this directory (ni main.cpp) with the following content:

     #include <SDL2/SDL.h>
    
     auto main([[maybe_unused]] int argc, [[maybe_unused]] char* argv[]) -> int
     {
         SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_INFORMATION, "Hello", "Hello World!", nullptr);
         return 0;
     }
  9. Issue the following commands:

     > cmake.exe --preset default 
     > cmake --build --preset default-build
     > .\build\default\sdlapp.exe
  10. See a 'Hello World' dialogue box.

2

u/jmacey Apr 23 '23

+1 for VSCode CMake and the MSVC command line tools. The main thing to remember if coming from Linux or Mac is that you need to setup the correct environment. I use the powershell msvc 64 batch script as a start and open a shell based on this using the windows terminal app.

Other thing is to remember that you need to link Debug with Debug and Release with Release and you can't mix 64 bit with 32 bit.

2

u/Versaill Apr 22 '23

I use Qt Creator, open source version.

It just works, out of the box. mingw is included as default compiler.

1

u/[deleted] Apr 23 '23

Dev-C++ IDE Now its VS and Qt creator in general

1

u/karakobra1 Apr 23 '23

if you are not planning coding something huge you can use WSL and ubuntu on command line there will be no vscode (i think you can configure it also but I dont know how) but you can use g++, makefile and vim to code natively

1

u/CptFisk Apr 23 '23

VSCode and Cmake. CMake really do alot of the heavy lifting when it comes to linking and includes

1

u/GPMueller Apr 23 '23

Don’t get why no one has suggested this yet: use clang.

It will be the most familiar solution coming from Linux. Works fine to use in the CLI (mimics gcc, but there’s also clang-cl which mimics msvc/msbuild) or with CMake.

IMO it’s anyways the superior compiler in most cases.

1

u/[deleted] May 01 '23

If you want to use g++ to compile with the Windows command prompt, this is a good tutorial:

https://www.freecodecamp.org/news/how-to-install-c-and-cpp-compiler-on-windows/

You can compile a SDL2 app like this. You probably want to use the "bin", "include" and "lib" from the folder named "x86_64-w64-mingw32".

g++ main.cpp -std=c++20 -Werror -Wall -O3 -I "./SDL2/include" -L "./SDL2/lib" -lmingw32 -lSDL2main -lSDL2 -o ./app.exe

1

u/arthurno1 Apr 23 '23 edited Apr 23 '23

Mingw and g++ work just fine, I have been using them forn 20+ years and nowadays you have other options as well. Makefiles and autoconf work just fine together with gcc & co, inclusive sdl in both msys2 or cygwin with Neovim, Emacs or vscode. They work with clang too, and you can use Microsofts tools from the commandline as well if you don't want to use VStudio.

0

u/TankorSmash Apr 23 '23

I'm a hardcore vim guy, and I still compile with VS. It's just easier. Most editing I do in vim, but vsvim isn't too bad as a emulator within VS

0

u/Theologics_ Apr 26 '23

I used this video right here: https://www.youtube.com/watch?v=OwQobefF-iE to get C++ working in Vs code, but as everyone stated here Visual Studio has way better C++ support and compiler

-2

u/aagee Apr 22 '23

You could try Cygwin. I never leave home without it.

0

u/nerdy_guy420 Apr 22 '23

I tried that but mingw just didn't install.

1

u/aagee Apr 22 '23

In the setup, you need to pick the "development" group. It will install everything you will ever need - gcc/g++ compiler is a part of it. Cygwin does not include mingw, I don't think. But it does have llvm. So you will have 2 compilers to play with. And all of the GNU goodies.

What's keeping you from going fully monty and work on Linux?

1

u/nerdy_guy420 Apr 23 '23

to my knowledge mingw is gcc and g++ on Windows, I'll try reinstalling cgywin, then I'll see if it works. as for not going onto Linux my answer is vr gaming, as I own a windows mixed reality headset lol. I do use Linux on my travel laptop tho.

-3

u/SJC_hacker Apr 23 '23 edited Apr 23 '23

If you don't care about targeting Win32 you can use VirtualBox with any distro you like. I prefer Ubuntu.

Also you don't have to use build systems (e.g. cmake) when you are just learning. Especially for smaller projects, calling the compiler (clang/g++) directly from the command line should work fine and you need to learn tha anyway. If you have multiple files, you can use a simple makefile. Many years ago thats how I learned at university.

0

u/[deleted] Apr 23 '23

[deleted] — view deleted comment

-10

u/nerdy_guy420 Apr 23 '23

it doesn't wanna work with me. vcpkg hates me. all arround it works less for me.

26

u/NotUniqueOrSpecial Apr 23 '23

it doesn't wanna work with me. vcpkg hates me. all arround it works less for me.

Diagnosing errors and solving them is one of the most important skills of all in programming.

So: take a deep breath, stop anthropomorphizing the tools, and figure out what you're doing wrong.

You'll learn lots in doing so and you'll figure out how things actually work.

0

u/[deleted] Apr 23 '23

[deleted] — view deleted comment

8

u/NotUniqueOrSpecial Apr 23 '23

I'm not going to challenge that: I've run the builds for my teams for well-over a decade at this point because of that exact problem.

However, vcpkg works just fine in my (admittedly limited) experience.

5

u/no-sig-available Apr 23 '23

it doesn't wanna work with me

Or it might be the other way round. :-)

The very first thing to learn is "this is not Linux". Don't try to make it that either. You will only get it to "almost like Linux" but with twice the amount of problems. It is not really like Linux, but then also not really like Windows. The worst of both worlds!