I now spent 3 hours trying to get C++ work on VScode

and I have used computers for 20 years

how can this shit still be so damn convoluted

POSIWID: The Purpose Of A System Is What It Does Shirt $21.68

Nothing Ever Happens Shirt $21.68

POSIWID: The Purpose Of A System Is What It Does Shirt $21.68

  1. 2 weeks ago
    Anonymous

    >making anything with the highly unsafe boomer languages
    Just use Rust you idiot

    • 2 weeks ago
      Anonymous

      troony language for troony people.
      Why are you troony?

    • 2 weeks ago
      Anonymous

      c is not safe. c++ is as safe as rust you idiot.

  2. 2 weeks ago
    Anonymous

    skill issue

  3. 2 weeks ago
    Anonymous

    Works fine with neovim (tm)

  4. 2 weeks ago
    Anonymous

    >now
    >spent
    You probably speak English for 20 years too and still make silly mistakes. Maybe it's just a skill issue, after all.

    • 2 weeks ago
      Anonymous

      what do you mean

      you know internet is a international place right?

    • 2 weeks ago
      Anonymous

      have spoken*

      what do you mean

      you know internet is a international place right?

      Not him, but I only want to speak with native English speakers. The Anglo Saxon made a tremendous mistake in exporting English and the internet. Very sad!

      • 2 weeks ago
        Anonymous

        You are literally making a case for why no one should ever hire you by putting your gross ineptitude on display. ESL to boot too, kek.

        you are not anglo saxon, Rajeesh. Even if you larp as one.

    • 2 weeks ago
      Anonymous

      >You probably speak English for 20 years too
      fricking esl ape lmao

  5. 2 weeks ago
    Anonymous

    >¡Ay, naranjas en la cabeza!

    • 2 weeks ago
      Anonymous

      lmao

      are you on windows? just use visual studio community

      This.

      It's convoluted because you chose it to be so.

  6. 2 weeks ago
    Anonymous

    are you on windows? just use visual studio community

    • 2 weeks ago
      Anonymous

      yes

      what does this even mean?

      that you need to install one thing then one thing then one thing then one thing

      and it maybe works

      • 2 weeks ago
        Anonymous

        So you're saying it's not vscode that's the problem but your compiler?

        • 2 weeks ago
          Anonymous

          I'm saying setting up a whole dev environment for C++, also using other libraries on frameworks, is the most convuluted process I've seen in any modern language

          why do you guys autist out over hurr durr just install exactly this program 1 time

          no professional works like that

          • 2 weeks ago
            Anonymous

            see

            [...]

            >$ cmake -G "Visual Studio 17 2022" -A x64 ..
            >bash: cmake: command not found

            A build system is orthogonal to the language.

    • 2 weeks ago
      Anonymous

      Should be using Visual Studio not VScode buddy

      Your mistake is "trying to make C++ work in <text editor". Let me guess, you're a Windowsgay? You need to use a build system like GNU Make, CMake, or Meson, and write a config for that. This has nothing to do with your text editor.

      doing C++ on windows means getting visual studio the IDE, not the VS Code text editor. windows is not complicated anon 🙂

      and if you need 3 hours to set up that shit on linux, just give up.

      Are you using windows? Just use just werks OS like mac or linux

      homie just type "make" on the commandline. Maybe go the extra mile and cmake .; make
      what the actual frick is wrong with you gui troony cattle

      >Are you stupid anon? Of course you need to use this specific editor (we can't even agree on which though), and obviously you have to manually configure your build system. Oh and you expect it to work on all major desktop platforms? That's ridiculous. You have to dev on X with XY setup and tools.
      Meanwhile all real languages like Go, Rust, Zig etc just work by default with no tinkering, everywhere. No wonder that the C/C++ ecosystem is making no progress at all and all new interesting software is made in other languages. It's because C trannies spend all day tinkering with config files and IDE extensions, and arguing on IQfy that it's actually impossible to make a language that actually works.

      • 2 weeks ago
        Anonymous

        I would do the same with all those languages as well.

      • 2 weeks ago
        Anonymous

        >real languages
        Appeal to purity, moron
        >new interesting software
        Like what? Does anyone use it?

      • 2 weeks ago
        Anonymous

        kek based
        I still don't get so many IQfygays are obsessed with C/Cpp beyond small performant modules only when needed
        they are objectively worse languages and make you do more shit. just pick a high level language to express your intention easier

  7. 2 weeks ago
    Anonymous

    Should be using Visual Studio not VScode buddy

  8. 2 weeks ago
    Anonymous

    what does this even mean?

  9. 2 weeks ago
    Anonymous

    Your mistake is "trying to make C++ work in <text editor". Let me guess, you're a Windowsgay? You need to use a build system like GNU Make, CMake, or Meson, and write a config for that. This has nothing to do with your text editor.

    • 2 weeks ago
      Anonymous

      but node works fine

      i mean compared to that or python for example or even java

  10. 2 weeks ago
    Anonymous

    doing C++ on windows means getting visual studio the IDE, not the VS Code text editor. windows is not complicated anon 🙂

    and if you need 3 hours to set up that shit on linux, just give up.

    • 2 weeks ago
      Anonymous

      i already had VScode, so I thought why not just add it

      is vistual studi free?

      install the extension and run from terminal? what's hard about this?

      you need to configure vscode to understand it also
      select a compiler

      then build it and so on and so on

      it's not hard per se, just a big convuluted process

      • 2 weeks ago
        Anonymous

        homie just type "make" on the commandline. Maybe go the extra mile and cmake .; make
        what the actual frick is wrong with you gui troony cattle

    • 2 weeks ago
      Anonymous

      you don't have to install the whole ide anymore, but the amount of shit you still have to download is obscene

    • 2 weeks ago
      Anonymous

      Doing C++ on Windows means installing MSYS2 and VS Code. There is no need for an IDE.

    • 2 weeks ago
      Anonymous

      this is the correct answer. Cpp on windows is as easy as it gets , installer will do it all for you, just tick the box for cpp

  11. 2 weeks ago
    Anonymous

    same experience, took me a whole day trying to figure out how to get the damn thing to work. I must say I haven't used c++ or c for that matter in over 10 years but still.
    the worst part? I already forgot how I did it

  12. 2 weeks ago
    Anonymous

    install the extension and run from terminal? what's hard about this?

  13. 2 weeks ago
    Anonymous

    Are you using windows? Just use just werks OS like mac or linux

  14. 2 weeks ago
    Anonymous

    Windows is cancer for C/C++, use this https://www.msys2.org/
    How to write a Makefile: https://www.softwaretestinghelp.com/cpp-makefile-tutorial/

    • 2 weeks ago
      Anonymous

      >just make your computer become linux
      frick no. if you need gcc(garbage c compiloooor) then just save mingw on some folder and add the bin folder to system 'path' variable

      • 2 weeks ago
        Anonymous

        the absolute state of windows "devs" lol

        • 2 weeks ago
          Anonymous

          MSVC>garbage system 2

      • 2 weeks ago
        Anonymous

        >gcc(garbage c compiloooor)
        HAHAHAHA HAVE YOU SEEN MSVC

        • 2 weeks ago
          Anonymous

          Not once I have got fricked in ass by using MSVC. Always I have got fricked in ass by GNU C. Why? Well, guess what: windows systems are not GNU project native so GNU has own quirks in replacement.

          • 2 weeks ago
            Anonymous

            ESL

          • 2 weeks ago
            Anonymous

            I've ran into some obscure bug with MSVC's C file IO calls a few years ago (win10). Randomly, it would fail to read a file in binary mode. I thought I was going crazy, but the same code ran perfectly under MinGW. The only hint on the entire internet was hidden in a single stackoverflow comment expressing the same exact situation. I wouldn't trust that shit for C++.

      • 2 weeks ago
        Anonymous

        um actually gcc stands for garbage compiloooor collection

      • 2 weeks ago
        Anonymous

        thats what I finally did yes

  15. 2 weeks ago
    Anonymous

    VSCode isn't some black box that will magically compile for you. Choose a build system, get it to work OUTSIDE of VSCode, then either write a minimal tasks.json file or get an extension to integrate your chosen build system into the editor. Or, you know, just use the built in terminal.

    • 2 weeks ago
      Anonymous

      >literally proving my point

      • 2 weeks ago
        Anonymous

        >guys why isn't notepad compiling my code correctly >;(

        • 2 weeks ago
          Anonymous

          Why isn't the gcc compiling it correctly? What's his problem?

        • 2 weeks ago
          Anonymous

          thanks again for proving my point and being obnoxious

          literally any other language except maybe perl is easier to get running than C++ on windows, and I am now also trying with the boost library

          • 2 weeks ago
            Anonymous

            LMAO, just install MSVC community edition, or Mingw64 if you want to use GCC. Is EZ AF.

          • 2 weeks ago
            Anonymous

            see

            [...]

            >$ cmake -G "Visual Studio 17 2022" -A x64 ..
            >bash: cmake: command not found

  16. 2 weeks ago
    Anonymous

    >Download a compiler of choice
    >Add to path
    >Use one of the 10 million C++ extensions
    Wow so hard anon

  17. 2 weeks ago
    Anonymous

    funny how everyone says it's easy but yet to give a detailed guide on how to do it and instead just gives vague answers.
    maybe it's not so easy after all

    • 2 weeks ago
      Anonymous

      main.cc
      #include <iostream>

      int main() {
      std::cout << "Hello World!n";
      return 0;
      }
      g++ -o hello main.cc
      ./hello
      Easy as. Now if you want to have it automated:
      https://www.softwaretestinghelp.com/cpp-makefile-tutorial/

      • 2 weeks ago
        Anonymous

        compile this (xbox360 controller shutter)

        #include "windows.h"
        #include "xinput.h"

        #pragma comment(lib, "XInput.lib")

        int main(int argc, char *argv[])
        {
        HINSTANCE hXInputDLL = LoadLibraryA("XInput1_3.dll");
        if (hXInputDLL == NULL)return 1;

        for(short i=0; i<4; ++i)
        {
        XINPUT_STATE state;
        memset(&state, 0, sizeof(XINPUT_STATE));
        if(XInputGetState(i,&state)==ERROR_SUCCESS)
        {
        typedef DWORD (WINAPI* XInputPowerOffController_t)(DWORD i);
        XInputPowerOffController_t realXInputPowerOffController=(XInputPowerOffController_t) GetProcAddress(hXInputDLL, (LPCSTR) 103);
        realXInputPowerOffController(i);
        }
        ZeroMemory(&state, sizeof(XINPUT_STATE));
        }
        FreeLibrary(hXInputDLL);
        return 0;
        }

        • 2 weeks ago
          Anonymous

          I don't haven an xbox controller.

          • 2 weeks ago
            Anonymous

            it does not matter. it sends shut down signal up to 4 controllers. it does nothing bad if you don't have even one. Compile it. If you can

        • 2 weeks ago
          Anonymous

          do you not know how to pass include dirs and dynamic lib locs to your commandline?
          is this your CS101 homework

          • 2 weeks ago
            Anonymous

            but it's different for every compiler

          • 2 weeks ago
            Anonymous

            its the same for clang and gcc
            what other compilers matter?

          • 2 weeks ago
            Anonymous

            Nah, It just happens that I have xbox360 controller on PC. Now can you do it? This is more like real life enviroment scenario outside fizz buzzing to CMD

        • 2 weeks ago
          Anonymous

          I hate cpp as much as the next guy cause its shit (same as rust) but this is a Windows problem not a cpp problem

          you're trying to build something that requires specific windows libraries and you don't know how to provide them. Check microsoft documentation or contact them for support, your issue has nothing to do with cpp in general

    • 2 weeks ago
      Anonymous

      How are they supposed to give detailed answers to a totally vague OP? What knowledge does OP already have? Does OP have a preferred build system? Someone could write a Makefile or a CMakeLists for you but that's not gonna teach you how to actually do shit yourself and without a bit more info nobody is gonna be able to do that.

      • 2 weeks ago
        Anonymous

        thanks for proving my point again 🙂

  18. 2 weeks ago
    Anonymous

    >open VSCode's built-in terminal
    >make
    ???

    • 2 weeks ago
      Anonymous

      yeah that doesn't work at all

      • 2 weeks ago
        Anonymous

        have you tried writing a Makefile first

        • 2 weeks ago
          Anonymous

          of course not
          i shouldn't even have to

          • 2 weeks ago
            Anonymous

            I'm glad we're not hiring zoomers anymore lol. Your generation is utterly useless. LLMs are a net improvement.

          • 2 weeks ago
            Anonymous

            HAHAHAHA
            Absolutely braindead take.
            >i shouldn't event have to
            Then who will?

          • 2 weeks ago
            Anonymous

            it should already do it by default
            why should i need to configure anything at all

          • 2 weeks ago
            Anonymous

            Any sort of real-life software development that isn't CS homework would require writing build files, be it for make, autotools, cmake, or meson.

          • 2 weeks ago
            Anonymous

            that's nonsense
            i highly doubt anyone is doing that outside of their basements
            i guarantee nobody working a job has to do that

          • 2 weeks ago
            Anonymous

            you clearly have never had a serious software development job
            webdev?

          • 2 weeks ago
            Anonymous

            it does not need any file. i compiled it on gcc. but not without other Anon's help.

            gcc [WHAT HERE?] main.cpp [AND HERE?]

          • 2 weeks ago
            Anonymous

            That's just for one file. If your program has multiple files, you will want to use a build system. Of course it's possible to compile a multi-file program by hand, but that's stupid.

          • 2 weeks ago
            Anonymous

            it's just 25 row script, anon

          • 2 weeks ago
            Anonymous

            25 rows too many and 1 script too much

          • 2 weeks ago
            Anonymous

            >25 row script
            If only there existed tooling and scripting languages specifically for building software...

          • 2 weeks ago
            Anonymous

            Don't tell him about unity builds

          • 2 weeks ago
            Anonymous

            >C++ gays actually believe this
            >the idea of a language with a default build system that works without tinkering is completely beyond their grasp

          • 2 weeks ago
            Anonymous

            >C++
            >language with a default build system
            I can't tell whether he's actually moronic or it's just really shit bait anymore.

          • 2 weeks ago
            Anonymous

            I'm having trouble parsing your posts, they might be a bit too moronic for me. Are you saying that C++ doesn't have a default build system? That's what my post was saying as well.
            Good languages have a default build system that works, so you don't have to waste time on irrelevant tinkering.

          • 2 weeks ago
            Anonymous

            >Are you saying that C++ doesn't have a default build system?
            Yes moron.
            >Good languages have a default build system that works, so you don't have to waste time on irrelevant tinkering.
            No. This is an exception rather than a rule. A language at its core is really just a specification. E.g. ECMAScript, C, C++. None of these come with build systems, because they're just specifications. Rust/Cargo is an exception here. Interpreted languages don't come with build systems because they're not built.
            C/C++ is a systems language, there is no one way to build C/C++ programs. Setting up a build system really isn't that hard if you know what you're doing. Arguably using Windows to learn it is shooting yourself in the foot.

          • 2 weeks ago
            Anonymous

            >there is no one way to build C/C++ programs.
            You keep repeating these things as if we don't already know them, but it looks like you're not thinking about them critically. Does it HAVE to be that way? What's the benefit?
            >Interpreted languages don't come with build systems because they're not built.
            The real world proves you wrong, C++ is almost always built. Examples in this thread:

            That's just for one file. If your program has multiple files, you will want to use a build system. Of course it's possible to compile a multi-file program by hand, but that's stupid.

            Any sort of real-life software development that isn't CS homework would require writing build files, be it for make, autotools, cmake, or meson.

            >Setting up a build system really isn't that hard if you know what you're doing.
            Again, what you say has no connection to the real world. Setting up a build system adds an incredible amount of complexity to C++ development, from the hobbyist spending hours trying to compile a simple Qt program on Windows, up to pic related.
            >Rust/Cargo is an exception here
            No, it's not. All "new" languages like Golang and Zig are going in the same direction: a single tool distributed with the compiler that makes all code and dependencies Actually Just Work with one command.
            It's an idea seemingly so obvious that it's kind of unbelievable that I have to argue about it. Even C++ libraries like SDL3 are finally realizing how bad the situation is and are doing their best to just work with as little interaction with the build system as possible. (https://cohost.org/danielg/post/627154-in-sdl3-sdl-main-wi)

          • 2 weeks ago
            Anonymous

            languages don't come with build systems because they're not built.
            >The real world proves you wrong, C++ is almost always built. Examples in this thread:

            That's just for one file. If your program has multiple files, you will want to use a build system. Of course it's possible to compile a multi-file program by hand, but that's stupid.

            (You)

            Any sort of real-life software development that isn't CS homework would require writing build files, be it for make, autotools, cmake, or meson.

            (You)
            >interpreted languages
            >C++
            ...

          • 2 weeks ago
            Anonymous

            You got me, you successfully confused me by bringing up interpreted languages for no reason even if nobody was talking about them. You still know what I mean in the rest of my post though.

        • 2 weeks ago
          Anonymous

          >just write some obscure makefile
          Why visual studio can understand everything without it? Why MSVC just works?

    • 2 weeks ago
      Anonymous

      yes then you neede some mingw32 library

      link it to the PATH

      restart vscode

      restart terminal

      export PATH

      do some build setups so the libraries work

      and so on and so on

      again, not saying its HARD just damn complicated

      • 2 weeks ago
        Anonymous

        Oh no, I have to add some shit to PATH in Windows. That's going to take all of 2 minutes in the fricking control panel.

  19. 2 weeks ago
    Anonymous

    All I should need to do is click file - use C++
    that is it
    if anything more is needed then they have failed
    i should not have to create make transform define anything at all

  20. 2 weeks ago
    Anonymous

    gcc in text editor: make make makefile. What should be written there? who knows.

    microsoft visual C in microsoft visual studio: just press the play button

    • 2 weeks ago
      Anonymous

      You are literally making a case for why no one should ever hire you by putting your gross ineptitude on display. ESL to boot too, kek.

  21. 2 weeks ago
    Anonymous

    Just use win64devkit

  22. 2 weeks ago
    Anonymous

    https://www3.ntu.edu.sg/home/ehchua/programming/cpp/gcc_make.html
    >The linker searches the so-called library-paths for libraries needed to link the program into an executable. The library-path is specified via -Ldir option (uppercase 'L' followed by the directory path) (or environment variable LIBRARY_PATH). In addition, you also have to specify the library name. In Unixes, the library libxxx.a is specified via -lxxx option (lowercase letter 'l', without the prefix "lib" and ".a" extension). In Windows, provide the full name such as -lxxx.lib. The linker needs to know both the directories as well as the library names. Hence, two options need to be specified.

    What the frick is the gcc linker's problem? Why you need specify the link like this

    gcc -lXInput main.cpp ---

    Why it just did not search for it? What the frick is wrong with this ancient unix shithole?

    • 2 weeks ago
      Anonymous

      >Why it just did not search for it? What the frick is wrong with this ancient unix shithole?
      Because there's often different libraries that define the same symbols.

      • 2 weeks ago
        Anonymous

        Then we come to the point why there was no error message?

    • 2 weeks ago
      Anonymous

      There's no need to do all of this yourself, you can use pkg-config.
      e.g. use this to get the flags and libs for libsoup:
      pkg-config --libs --cflags libsoup-2.4

      • 2 weeks ago
        Anonymous

        i will never install msys2 to my precious computer.

  23. 2 weeks ago
    Anonymous

    Why Microsoft Visual Studio searches depencies from almost everywhere and even if it fails, then you can just add the missing path from a human usable menu? Why GCC cannot search from paths that it already knows? it still needs to be linked manually

    https://stackoverflow.com/questions/335408/where-does-visual-studio-look-for-c-header-files

    • 2 weeks ago
      Anonymous

      You are comparing Visual Studio (a graphical IDE which allows graphical management of project configuration) to GCC (a compiler). To give a fair comparison, try comparing gcc to cl.exe instead and see how far you get with trying to specify custom include directories to the latter.

      Or just compare Visual Studio with another IDE which allows you to configure stuff instead of comparing it with a bare command line compiler that needs everything to be specified to it (which is the job of the build system, usually included in an IDE).

      • 2 weeks ago
        Anonymous

        cl.exe won't let you shit your own bed, and thus is only callable from visual studio promptline. it also seem to link just fine and needs explicite /c flag to not.

        https://learn.microsoft.com/en-us/cpp/build/reference/compiler-options?view=msvc-170

        If you want to use GCC and windows, I too seriously recommend a proper IDE and that would be the Eclipce C IDE

        • 2 weeks ago
          Anonymous

          >cl.exe won't let you shit your own bed, and thus is only callable from visual studio promptline
          this is not remotely true, you can run cl.exe from any windows terminal
          people do it all the time for msvc builds for projects that aren't VS projects

  24. 2 weeks ago
    Anonymous

    >https://code.visualstudio.com/docs/languages/cpp

    >just press build and run, goy
    >what do you mean i did not include the XInput.dll?
    >this one webpage must work!

  25. 2 weeks ago
    Anonymous

    https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner

    1.4 billion indians can't be wrong

  26. 2 weeks ago
    Anonymous

    [...]

    Well then just install cmake.

    • 2 weeks ago
      Anonymous

      but... some posts above it was just to install exactly 1 program ?

      • 2 weeks ago
        Anonymous

        Said who?

        • 2 weeks ago
          Anonymous

          this for example

          Windows is cancer for C/C++, use this https://www.msys2.org/
          How to write a Makefile: https://www.softwaretestinghelp.com/cpp-makefile-tutorial/

          >Download a compiler of choice
          >Add to path
          >Use one of the 10 million C++ extensions
          Wow so hard anon

          • 2 weeks ago
            Anonymous

            Windows is cancer for C/C++, use this https://www.msys2.org/
            How to write a Makefile: https://www.softwaretestinghelp.com/cpp-makefile-tutorial/

            MSYS2 not strictly a "program" per se, it's an environment that can install other software. Also in MSYS2 you typically uses pacman to install packages (similar to Arch Linux).

            >Download a compiler of choice
            >Add to path
            >Use one of the 10 million C++ extensions
            Wow so hard anon

            I think it's vcpkg that needs CMake here.

  27. 2 weeks ago
    Anonymous

    [...]

    vcpkg is such a fricking scam
    I think it worked only once out of the dozens of times I tried to get a library working from there

    • 2 weeks ago
      Anonymous

      but it was just to install one(1) command everyone else said here

  28. 2 weeks ago
    Anonymous

    Use code::blocks, it comes packaged with toolchain on windows. Or install MSYS2 or whatever is it used on windows these days.

  29. 2 weeks ago
    Anonymous

    shitty docs. people cannot document shit. Try compiling beeflang next see what a mess that is if you don't have llvm.so.13 saved as llvm-13.so.

  30. 2 weeks ago
    Anonymous

    [...]

    >cmake command not found
    cmake is cancer, try xmake.
    you don't need vcpkg either because xmake can manage dependencies.

    • 2 weeks ago
      Anonymous

      >xmake
      >lua

  31. 2 weeks ago
    Anonymous

    [...]

    How the frick have you messed up vcpkg. It does everything for you lmao

  32. 2 weeks ago
    Anonymous

    >*write C++ code*
    >oh, I need to build it, gonna use that cmake thing
    >*runs cmake*
    >EH ERROR
    >ops, I probably forgot to install the compiler
    >*runs cmake*
    >EH ERROR
    >wtf, man, everything is installed fine
    >*waits 3 years until ChatGPT is launched*
    >damn, this AI thing is great, i'll finally learn how to compile a C++ project
    >*asks help to chatgpt*
    >oh, cmake isn't actually a build system nor a compiler, I'll to install this ninja thing
    >*hello world compiles*
    >cool, now I'll compile Godot
    >What? Why do I need to install all those other softwares to compile that shit?
    The average C++ dev life.

    • 2 weeks ago
      Anonymous

      >What? Why do I need to install all those other softwares to compile that shit?
      >The average C++ dev life.
      The average Windows experience. When you don't have a package manager to install libraries.

  33. 2 weeks ago
    Anonymous

    you didn't even have to set it up if you used Xcode
    it just werks out of the box

  34. 2 weeks ago
    Anonymous

    >Type up C++ code in VSCode
    >Alt tab to your terminal
    >g++ -o blah.exe *.cpp
    I don't understand how this takes 3 hours.

  35. 2 weeks ago
    Anonymous

    >VScode
    Found the error.

Your email address will not be published. Required fields are marked *