Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. C++ Linux Development on Windows

C++ Linux Development on Windows

Scheduled Pinned Locked Moved The Lounge
linuxdebuggingc++asp-netvisual-studio
22 Posts 19 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Jon McKee

    I've never done anything crazy in it but I use VirtualBox with Debian for some linux stuff. Aside from some of the convenience options sometimes bugging out (like cut/paste between VM and host) it's been pretty solid. You HAVE to install the Guest Additions though - lots of QoL improvements. Ubuntu didn't run the best on it for me but that also might be my setup because I know it has for others. I'll have to check out VMWare Player though. Maybe I just don't know what I'm missing :-D

    H Offline
    H Offline
    honey the codewitch
    wrote on last edited by
    #12

    I just know I had issues with it capturing USB devices. The devices would capture but then they would come back with some kind of failure whenever I tried to access them - except once in a blue moon they would magically work.

    Real programmers use butterflies

    J 1 Reply Last reply
    0
    • H honey the codewitch

      I just know I had issues with it capturing USB devices. The devices would capture but then they would come back with some kind of failure whenever I tried to access them - except once in a blue moon they would magically work.

      Real programmers use butterflies

      J Offline
      J Offline
      Jon McKee
      wrote on last edited by
      #13

      The only useful thing I found when I searched was [this](https://forums.virtualbox.org/viewtopic.php?f=35&t=82639) but I've really only ever used basic keyboard and mouse so never had to worry about those things. Does seem like a recurring issue though.

      1 Reply Last reply
      0
      • Greg UtasG Greg Utas

        In this thread[^] from yesterday, Linux development on Windows was discussed. I want to do this eventually and would appreciate any pointers so I don't bang my head against the wall, let alone get it nailed to the floor. I currently build C++ console applications on Windows, and that's all I need on Linux for now. So... 1. Which Linux do you run? Debian? Ubuntu? RedHat? 1. How do you run it on your Windows machine? In a VM? If so, which one? Or using WSL? 1. How do you edit? VS2017? VS2019? VS Code? vi? :laugh: 1. How do you build? Within Linux? From within VS?[^] 1. Which compiler do you use? g++? clang? 1. How do you debug? Within Linux? If so, which debugger? Or remotely, from within VS? 1. How do you interface to GitHub? Within Linux? Using the VS plug-in? 1. What should be avoided? Thanks.

        Robust Services Core | Software Techniques for Lemmings | Articles
        The fox knows many things, but the hedgehog knows one big thing.

        R Offline
        R Offline
        riki_p
        wrote on last edited by
        #14

        I have Ubuntu as main OS of my notebook and use Windows inside a Virtualbox VM. 1) Ubuntu 2) Linux as main OS, Windows in a VM 3) QtCreator 4) build within QtCreator (cmake / qmake) 5) both gcc and clang (MinGW and occasionally VS on windows) 6) Inside QtCreator using gdb 7) within QtCreator or with git cli (remotes on gitlab) 8) my personal feeling.... Windows :) Main thing here is that in my personal opinion QtCreator is *much* better than VSCode for C++ development (unfortunately I have to use VSCode for other non C++ projects and I find it quite messy and chaotic).

        S 1 Reply Last reply
        0
        • Greg UtasG Greg Utas

          In this thread[^] from yesterday, Linux development on Windows was discussed. I want to do this eventually and would appreciate any pointers so I don't bang my head against the wall, let alone get it nailed to the floor. I currently build C++ console applications on Windows, and that's all I need on Linux for now. So... 1. Which Linux do you run? Debian? Ubuntu? RedHat? 1. How do you run it on your Windows machine? In a VM? If so, which one? Or using WSL? 1. How do you edit? VS2017? VS2019? VS Code? vi? :laugh: 1. How do you build? Within Linux? From within VS?[^] 1. Which compiler do you use? g++? clang? 1. How do you debug? Within Linux? If so, which debugger? Or remotely, from within VS? 1. How do you interface to GitHub? Within Linux? Using the VS plug-in? 1. What should be avoided? Thanks.

          Robust Services Core | Software Techniques for Lemmings | Articles
          The fox knows many things, but the hedgehog knows one big thing.

          G Offline
          G Offline
          giulicard
          wrote on last edited by
          #15

          Greg Utas wrote:

          • Which Linux do you run? Debian? Ubuntu? RedHat?
            Ubuntu on 20.04 LTS on WSL2 using Windows 10 Pro insider ed. 21H2 Build 21382.1000 (Yes, I couldn't resist testing WSL with "native" graphics)* How do you run it on your Windows machine? In a VM? If so, which one? Or using WSL?
            Lastest WSL 2 based on MS' Mariner distro* How do you edit? VS2017? VS2019? VS Code? vi? :laugh:
            VS Code, absolutely! Of course with all the extensions required for editing, building, and debugging C ++ applications.* How do you build? Within Linux? From within VS?[^]
            I personally use VS Code with the GUI running on Windows and connected remotely to WSL. With the extension for VS Code that supports CMAKE you can easily and conveniently use VS Code on Windows to develop and debug both graphical and console applications on Linux. Note: it does not cross-compile on Windows for Linux; it uses the Linux toolchains on Linux but from an IDE on Windows (i.e. VS Code). It is also very advisable to use Windows Terminal to open WSL console sessions or to connect to Linux with ssh as well.* Which compiler do you use? g++? clang?
            Both gcc (lastest, g++-11) and clang-12 (experimental).* How do you debug? Within Linux? If so, which debugger? Or remotely, from within VS?
            gdb, lldb, With VS Code.* How do you interface to GitHub? Within Linux? Using the VS plug-in?
            With git (command line, i.e. bash).* What should be avoided?
            I had a lot of difficulties using wxWidgets due to binary incompatibility between libraries of different versions. Furthermore, many applications installed with apt also suffer from the above problem. Anyway, I have tested qtcreator (qt5) and it works fine. I also used glade to design a small GUI for gtk and linked it to a C++ project (g ++) I also tested it with rustc.

          Extensions I've installed in VS Code to write Linux programs are:* C/C++ IntelliSense, debugging, and code browsing. (ms-vscode.cpptools)

          • C/C++ Extension Pack (ms-vscode.cpptools-extension-pack)
          • C++ Intellisense (austin.code-gnu-global)
          • CMake (twxs.cmake)
          • CMak
          1 Reply Last reply
          0
          • Greg UtasG Greg Utas

            In this thread[^] from yesterday, Linux development on Windows was discussed. I want to do this eventually and would appreciate any pointers so I don't bang my head against the wall, let alone get it nailed to the floor. I currently build C++ console applications on Windows, and that's all I need on Linux for now. So... 1. Which Linux do you run? Debian? Ubuntu? RedHat? 1. How do you run it on your Windows machine? In a VM? If so, which one? Or using WSL? 1. How do you edit? VS2017? VS2019? VS Code? vi? :laugh: 1. How do you build? Within Linux? From within VS?[^] 1. Which compiler do you use? g++? clang? 1. How do you debug? Within Linux? If so, which debugger? Or remotely, from within VS? 1. How do you interface to GitHub? Within Linux? Using the VS plug-in? 1. What should be avoided? Thanks.

            Robust Services Core | Software Techniques for Lemmings | Articles
            The fox knows many things, but the hedgehog knows one big thing.

            S Offline
            S Offline
            Stuart Dootson
            wrote on last edited by
            #16

            1. Ubuntu 18.04, using a mix of the `apt` and `nix` package managers (`apt` because it's the standard Ubuntu one, `nix` where I want newer versions of tools like CMake and ninja than are offered by `apt` in 18.04). 2. WSL1 (I don't use WSL2 because I want to work on a Windows filesystem, and WSL1 is better in that scenario). 3. VSCode running under Windows (possibly using the Remote extension, but with WSL, VSCode doesn't necessarily need that). 4. I do builds using a WSL bash prompt running in VSCode's integrated terminal. However - you can run a WSL command-line from a CMD or Powershell prompt too. I actually perform Linux *and* Windows builds from WSL bash. VSCode's 'tasks' can be used to do the builds as well. I use CMake and ninja to perform builds - I find CMake the simplest way to have a single cross-platform build description. 5. On Windows, MSVC. On Linux, I build with g++ but use clang's static analysis tools (`clang-tidy` primarily). oh - unless I'm doing a fuzzing build, when I use clang and libfuzzer. 6. I use VSCode for all debugging. It integrates with the native debugger that (I guess) Visual Studio uses, and for WSL, it fires up a gdb running under a WSL process and automates it using GDB's 'machine interface'. 7. I use command-line Git (usually the Linux version, but if I use `git.exe` at the command prompt rather than `git`, I'm using Windows native Git rather than Linux Git) and also [GitKraken](https://www.gitkraken.com/) running under Windows. The only concessions I make to Windows are some git config settings: `core.filemode` is set to `false` and `core.ignorecase` to `true`. 8. Can't remember anything offhand... I've been working like this *very happily* since 2018, doing Windows and Linux builds in tandem. The way I work is to develop under Windows primarily, then when I reach some significant point build under Linux (with static analysis) and run unit tests to ensure that I have parity between platforms. I have some projects with Windows-only features - I find that's easy enough to do with CMake. The only time I break out Visual Studio is if I need disassembly level debugging - one of the projects I work on has a JIT compiler, and debugging the JITted code needs that really. Aside from that, I often find myself developing small, self-contained features in [Compiler Explorer](https://godbolt.org/), as that makes it easy to use libraries I often use ([fmt](https://fmt.dev/latest/index.html), [MS-GSL](https://github.com/Microsoft/GSL), [Catch2](https://githu

            1 Reply Last reply
            0
            • Greg UtasG Greg Utas

              In this thread[^] from yesterday, Linux development on Windows was discussed. I want to do this eventually and would appreciate any pointers so I don't bang my head against the wall, let alone get it nailed to the floor. I currently build C++ console applications on Windows, and that's all I need on Linux for now. So... 1. Which Linux do you run? Debian? Ubuntu? RedHat? 1. How do you run it on your Windows machine? In a VM? If so, which one? Or using WSL? 1. How do you edit? VS2017? VS2019? VS Code? vi? :laugh: 1. How do you build? Within Linux? From within VS?[^] 1. Which compiler do you use? g++? clang? 1. How do you debug? Within Linux? If so, which debugger? Or remotely, from within VS? 1. How do you interface to GitHub? Within Linux? Using the VS plug-in? 1. What should be avoided? Thanks.

              Robust Services Core | Software Techniques for Lemmings | Articles
              The fox knows many things, but the hedgehog knows one big thing.

              D Offline
              D Offline
              Deoclecio Freire
              wrote on last edited by
              #17

              For five year I used to develop in C++ on Windows for both Windows and Linux. In the beginning I try to use Visual Studio solution for cross platform and failed miserably; on all VS versions 2015, 2017, 2019... Too many problems when projects grows. X| Another problem I had was to have to "program" the build on Linux using Make, CMake ... I don't want to "program" the build, for me, basically, build a C/C++ project is just a matter to make a long command line. From one year being fully on home office I completely abandoned Windows and now work fully on Linux (Debian 10), but need to build my projects on Windows too. So I adopted VSCodium as my main editor and construc a mini build system (CPPMagic) that meet my needs, fully in Python. With this I can build on both Windows and Linux the same way (no need even an editor). 1. Debian 10; 2. I use 2 phisical machines; 3. VSCodium; 4. CPPMagic (CppMagic: A Python 3 script to help build C/C++ projects cross-platform.[^]); 5. GCC and MSVC; 6. GDB on Linux and MSVC on Windows; 7. Command line; 8. I personally don't like to use complex building systems and whenever I can use static libraries. I don't clame that my build system is a final solution, it still raw, and I evolve just for my needs, but it works. :)

              1 Reply Last reply
              0
              • Greg UtasG Greg Utas

                In this thread[^] from yesterday, Linux development on Windows was discussed. I want to do this eventually and would appreciate any pointers so I don't bang my head against the wall, let alone get it nailed to the floor. I currently build C++ console applications on Windows, and that's all I need on Linux for now. So... 1. Which Linux do you run? Debian? Ubuntu? RedHat? 1. How do you run it on your Windows machine? In a VM? If so, which one? Or using WSL? 1. How do you edit? VS2017? VS2019? VS Code? vi? :laugh: 1. How do you build? Within Linux? From within VS?[^] 1. Which compiler do you use? g++? clang? 1. How do you debug? Within Linux? If so, which debugger? Or remotely, from within VS? 1. How do you interface to GitHub? Within Linux? Using the VS plug-in? 1. What should be avoided? Thanks.

                Robust Services Core | Software Techniques for Lemmings | Articles
                The fox knows many things, but the hedgehog knows one big thing.

                H Offline
                H Offline
                hur10forcer10
                wrote on last edited by
                #18

                You are asking some great questions here! 1. Ubuntu distro, typically later than 16. 2. I do development using an Oracle VirtualBox VM running on Windows 10. I like the ability to manage separate VMs for separate development environments and always save both an "O/S only" VM as well as a "O/S + development tools" VM. I usually do full clones of the "O/S only" for build and deployment testing and use the "O/S + development tools" to create new development environments for separate projects. Full clones eat disk space like nobody's business, so you need a good hunk of disk storage. 3. I use...wait for it...Eclipse for editing and the GUI debugger (which is just a GUI riding on top of gdb). I often hear bad things said about Eclipse, and I have to agree, some of them are justified, but I like the things an IDE has to offer even though Eclipse ain't great like GUI debugging, the code indexer so you can right click on a variable or method and it will take you there, etc. It often takes a while to get Eclipse configured to do builds and debug (in both C++ as well as mixed C++/Python where Python is the typical entry point) and can be frustrating. I've had a lot of issues with the indexer picking up dependencies. 4. My build model typically consists of cmake with hierarchical CMakeLists.txt files. cmake has a generator that can produce eclipse project files via the -G"Eclipse CDT4 - Unix Makefiles" option, which is handy and seems to work pretty well, but honestly haven't tried it on the latest versions of Eclipse. One key thing you have to account for is that the generator (at least in the past) doesn't like a folder structure that stores build files in a subfolder lower in the directory hierarchy, e.g. doesn't like ~/username/MyProjects/SoftwareProjectA/build, so you have to get cmake to create the top-level Makefile directly in the top-level of the source tree, i.e. ~/username/MyProjects/SoftwareProjectA. This will allow you to debug your code using the Eclipse GUI front-end to gdb. 5. g++. Basically, go to source tree and run "cmake -G"Eclipse CDT4 - Unix Makefiles" -DENABLE_DOXYGEN=$BUILDDOCS -DCMAKE_BUILD_TYPE= -DCMAKE_INSTALL_PREFIX= .", then run "make -j4 install". 6. I typically use the Eclipse GUI-based gdb debugger, but this can be tricky to set up sometimes, but worth it. 7. Interface to github is usually done through Linux command-line "git". 8. Playing poker with anyone whose first name is preceded by a city, e.g. "Minnesota Jim

                1 Reply Last reply
                0
                • R riki_p

                  I have Ubuntu as main OS of my notebook and use Windows inside a Virtualbox VM. 1) Ubuntu 2) Linux as main OS, Windows in a VM 3) QtCreator 4) build within QtCreator (cmake / qmake) 5) both gcc and clang (MinGW and occasionally VS on windows) 6) Inside QtCreator using gdb 7) within QtCreator or with git cli (remotes on gitlab) 8) my personal feeling.... Windows :) Main thing here is that in my personal opinion QtCreator is *much* better than VSCode for C++ development (unfortunately I have to use VSCode for other non C++ projects and I find it quite messy and chaotic).

                  S Offline
                  S Offline
                  stephen hazel
                  wrote on last edited by
                  #19

                  i vote for qtcreator, too. qt is super frickin great imho. i'm just like you except my flavor is kubuntu. just ubuntu w kde instead o gnome.

                  1 Reply Last reply
                  0
                  • Greg UtasG Greg Utas

                    In this thread[^] from yesterday, Linux development on Windows was discussed. I want to do this eventually and would appreciate any pointers so I don't bang my head against the wall, let alone get it nailed to the floor. I currently build C++ console applications on Windows, and that's all I need on Linux for now. So... 1. Which Linux do you run? Debian? Ubuntu? RedHat? 1. How do you run it on your Windows machine? In a VM? If so, which one? Or using WSL? 1. How do you edit? VS2017? VS2019? VS Code? vi? :laugh: 1. How do you build? Within Linux? From within VS?[^] 1. Which compiler do you use? g++? clang? 1. How do you debug? Within Linux? If so, which debugger? Or remotely, from within VS? 1. How do you interface to GitHub? Within Linux? Using the VS plug-in? 1. What should be avoided? Thanks.

                    Robust Services Core | Software Techniques for Lemmings | Articles
                    The fox knows many things, but the hedgehog knows one big thing.

                    J Offline
                    J Offline
                    Joe Woodbury
                    wrote on last edited by
                    #20

                    When I did Linux development, I preferred using Fedora in a VirtualBox VM. I vastly preferred using CLion as my IDE (though used Eclipse for one job. I shudder.) When I first started Linux development, both GCC and Clang were stalled. GCC got it's act together. It took a while for Clang to do so. Yet, as they did, I found their response to well documented bugs severely lacking to the point where I still don't trust them.

                    1 Reply Last reply
                    0
                    • J Jon McKee

                      I've never done anything crazy in it but I use VirtualBox with Debian for some linux stuff. Aside from some of the convenience options sometimes bugging out (like cut/paste between VM and host) it's been pretty solid. You HAVE to install the Guest Additions though - lots of QoL improvements. Ubuntu didn't run the best on it for me but that also might be my setup because I know it has for others. I'll have to check out VMWare Player though. Maybe I just don't know what I'm missing :-D

                      J Offline
                      J Offline
                      Joe Woodbury
                      wrote on last edited by
                      #21

                      It's been five years, but I found VirtualBox better for running Linux and VMWare better for running Windows. (And I found both problematic with USB so never bothered.)

                      1 Reply Last reply
                      0
                      • Greg UtasG Greg Utas

                        In this thread[^] from yesterday, Linux development on Windows was discussed. I want to do this eventually and would appreciate any pointers so I don't bang my head against the wall, let alone get it nailed to the floor. I currently build C++ console applications on Windows, and that's all I need on Linux for now. So... 1. Which Linux do you run? Debian? Ubuntu? RedHat? 1. How do you run it on your Windows machine? In a VM? If so, which one? Or using WSL? 1. How do you edit? VS2017? VS2019? VS Code? vi? :laugh: 1. How do you build? Within Linux? From within VS?[^] 1. Which compiler do you use? g++? clang? 1. How do you debug? Within Linux? If so, which debugger? Or remotely, from within VS? 1. How do you interface to GitHub? Within Linux? Using the VS plug-in? 1. What should be avoided? Thanks.

                        Robust Services Core | Software Techniques for Lemmings | Articles
                        The fox knows many things, but the hedgehog knows one big thing.

                        K Offline
                        K Offline
                        KateAshman
                        wrote on last edited by
                        #22

                        1. Anything Debian-based can be considered a "typical" Linux 2. WSL when you don't need X11 or Wayland or specific device drivers, VM when you do 3. VS Code if you just want to get the job done, Visual Studio if you prefer IntelliSense 4. using the Clang support in VS Code or Clang support in Visual Studio 5. Clang 6. Waiting for debugger support in WSL, I just build for Windows and debug that instead. YYMV 7. VS plugin because it's easy to use, does everything, and prevents me from making typo's

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups