3

My main desktop system runs Windows, but I need to create some C/C++ programs that run on Linux, so I have installed Ubuntu on another computer, and I am accessing it via SSH and VNC.

I would like to make all the possible part of the work on my Windows system, then send the programs to the Linux machine and test it there.

My programs are some rather simple shell tools that works with CSV text files, no need for GUI. Minor things like field filtering, searching and so on.

Is there a practical programming environment that I could install on my Windows machine and will allow this? Can I use some useful programming tools like breakpoints and step by step execution on it?

Notes:

  • Open Source solutions preferred.
  • Free solutions preferred over payment ones.
  • Payment solutions accepted.
  • "I need to create some C programs" then why does the question title say C++ ? – Mawg Mar 4 at 11:48
  • 1
    Edited to reflect C/C++ . Thanks you. – Sopalajo de Arrierez Mar 4 at 14:33
3

Just install Ubuntu (lubuntu?) in VirtualBox. You would need 6-10GB disk space, 1GB+ RAM for virtual machine and preferably processor not older then 10 years old (mobile C2D worked for me but VS Code was sluggish). If you want IDE features then Code::Blocks is in repository, unless you prefer Eclipse or Netbeans.

  • This. You are missing out on a wonderful rich development environment by not using a Linux desktop, especially for this task. Plenty of good IDEs available, or just get good at vi/vim/emacs and the command line. – ivanivan Mar 5 at 3:48
3

Code::Blocks is a cross platform IDE that provides a great programming environment and is compatible with multiple tool chains for C/C++/Fortran including GCC (MingW / GNU GCC) and many others.

For the tool chain on Windows you can use MinGW or if you are on Windows 10 Pro you can install the Windows Subsystem for Linux.

With either option you can build & test your C/C++ code using gcc on your Windows platform before moving the source code to Linux and building/testing there.

  • Code::Blocks:
    • Free, Gratis & Open Source
    • Compatible with multiple tool chains
    • Can be used to debug with GNU GDB
    • Custom tool chains supported
  • MinGW
    • Free, Gratis & Open Source
    • Runs on Multiple Versions of Windows
    • Includes gcc & gdb
  • Windows Subsystem for Linux
    • Gratis if you have the right version of Windows
    • Windows 10 only
    • Some closed source
    • You will have to tailor Code::Blocks
  • Could I use this method too for code targeted to FreeBSD instead of Linux? – Sopalajo de Arrierez Mar 5 at 10:51
  • I have successfully used this method to target a number of operating systems and boards without operating systems. For the latter you need to get a gcc cross compilation environment set up. In either case GDB, which Code::Blocks can talk to, has the remote debugging capability. – Steve Barnes Mar 6 at 13:16
1

Not open source, but free, take a look at Cygwin which can do all that you want.

Cygwin is a large collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows.

So, you will have all your familiar bash (or other shell) commands, such as ls, rm, mv, cp , sed, grep, etc, plus, of course, gcc/g++ to compile & link and gdb to debug. You don't want it, but you an also run X for GUI stuff.

The advantage of Cygwin is that won't even need to remote into your Linux box. You can compile and run from the Cygwin command line on your Windows machine.

  • 1
    Well, I was rather thinking of a programming environment, like the answer of @SteveBarnes above. Anyway, for the testing part maybe CygWin could help. Thanks you. – Sopalajo de Arrierez Mar 5 at 10:57
0

I had a coworker who used Notepad++ on Windows and edited via ssh to a Linux box.

How to edit files using Notepad++ over SSH File Transfer Protocol

https://blog.sleeplessbeastie.eu/2015/07/27/how-to-edit-files-using-notepad-plus-plus-over-ssh-file-transfer-protocol/

There is also a Console plugin that I think lets you do putty access.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.