Connecting to a linux system using a Windows IDE for a C/C++ project - c++

I am new to Linux and therefore feel difficult to code and develop in Linux based environment (CentOS).
Although coding is still fine, I find debugging a quite challenging task because of the lack of breakpoints and the ease of navigating through various class, function and variable definitions that we can do in the blink of an eye using Windows/Mac IDE's.
This leads me to the question :
Can I use a windows IDE to connect to my Linux system and import my project repository and develop on it?
I did some research on using Visual Studio 2017 for this purpose and found a few articles, but most of them explain how I start up with a new project rather than importing/developing upon an existing project.
I also had a look at an article that mentioned about Visual GDB but it wasn't very clear to me, so any pointers on how I can use that would be great.
Any other IDE that I can use on windows for the same purpose? (Visual studio is just something that I looked into, but any other suggestions are also welcome.)
NOTE: My project has both C and C++ code (networking domain), so hence both the tags.

Related

Free alternative to QTCreator for QT/C++ development

Let me preface this by stating I have vision problems so I have to magnify my screen upwards of 400% minimum to read most things including code - even when I am using a dark theme as I do when I code.
QTCreator has an issue where it moves the view on me with most keystrokes & actions - usually to the top left corner by the project file listing. I've posed questions to QT Support and even cloned the source for QT Creator looking to see if I could identify a relatively easy fix - to no avail. So now I'm trying to find a free (as in no financial cost) alternative to QT Creator so I can keep programming using QT Creator in C++.
I've tried Visual Studio Community Edition (2017 and 2019) and had problems getting things to build. It seemed like I had to rebuild the entire framework libraries for MSVC or else it wouldn't work. Additionally it seems it finds compilation errors in even the framework source - which doesn't even look wrong to me or I'd try to repair it.
I tried Eclipse (as I'm a Java engineer for my job so I'm familiar with Eclipse for Java and it does not have the problem that QT Creator has. The QT plugin - when I try to put a simple line of #include - It claims "QApplication" is unresolved. I've looked for this and all the answers say about Project->Properties->Paths and Symbols but as of 2019-12 and 2020-03, there are no options in settings for paths and symbols unfortunately.
A colleague suggested CLion from JetBrains but unfortunately it appears you have to pay for that. I have no intention of paying for a compiler or IDE.
Any thoughts on how I can get around this view changing problem or an alternative to QTCreator that doesn't cost money? If there's a setting in one of the applications I may have missed, suggest it with the version of the appication and I'll look for it and reply if it doesn't exist for whatever reason or accept your answer if it does and fixes the problem.
Thank you!
If you are familiar with Eclipse but have issues with the plugins and you intend using it for C++ I recommend checking out Cevelop (https://www.cevelop.com/) it's basically Eclipse but only for C++ and has some optimizations.
If that doesn't work for you technically you should be able to use any code editor like VSCode or Atom, but I do not know how well that works with the Qt library.
CLion is free for students but I think that doesn't apply for you.
NetBeans (https://netbeans.org/) is also free and cross-platform.
(https://netbeans.org/kb/74/cnd/qt-applications.html)
It should be possible to use Qt within the IDE.

Windows7+: How to build a C++ Windows Console application that doesn't require any additional/external runtime libraries?

This has probably been asked/answered dozens of times, but even after going/reading through many of these questions, i still can't figure out what to do...
Anyhow: I'm trying to write a standalone X86/32-bit C++ Windows console application using Visual Studio 2017 Community Edition (under Windows 10 x64) that runs some CMD.exe commands.
The problem: When trying to run the application on Windows 7, a dialog box pops up with a message saying that a required runtime library couldn't be found.
As i happen to be fairly new to developing/coding, you can probably understand how overwhelmed i am/was when going through Visual Studio's (project) options.
The goal to reach: I would like to know if there's a way (and how) to make my C++ console application work on Windows 7 and onwards, while ONLY using the operating system's built-in/default shipped libraries (if possible without requiring the .NET framework to run the program).
The application's purpose is really simple and is meant for learning the basics of Visual Studio development.
Hopefully someone can help me out. I know i'm supposed to uncheck any recent SDK's in the Visual Studio Installer, but at the same time it appears that the .NET framework seems to be a required component for writing/compiling CLI applications :S
I don't even know why you mention .net for C++. You only need the C++ runtime. That can be statically linked.
Well guys (i assume?), i've returned with some good news.
I'm also answering my own question since i have found a solution that gave me everything i asked/hoped for.
Code::Blocks IDE gave me both a very small program/exe of ~10kB, and it even worked without any additional/extra runtime libraries (i've tested this under a fresh/clean virtual OS # VMware Player).
Thank you all for the given support, you've been really helpful :-)

How to organize Windows and Android builds of my C++ game?

I would like to develop a Windows build of my Android game for testing and demo purposes. Most of my code is C++, using OpenGL to render, with a thin Android/Java layer that forwards touch events and loads resources.
My first thought was to make a Visual Studio project for my Windows version, as I'm familiar with it and the debugger is excellent.
Can I get similar C++ debugging functionality with Eclipse & CDT? It seems tidier to have all versions working from the same IDE, and it would be nice to become less dependant on proprietary software. Would I be able to add a Windows build configuration in CDT, switch over, and have the IDE launch & debug my Windows version instead? Or would I be entering a world of pain setting this up?
Are there any other approaches I haven't considered? All advice welcome!
CDT is a perfectly good Windows development environment. Just make sure that you have installed the Windows SDK.
If the concern is that Visual Studio puts a lot of the Windows-specific code in place for you, you might consider starting a new project in it. I'd avoid MFC. Just create a new Win32 project. Then, you could take that code and use it as the basis for your Eclipse project, folding in the platform-independent code from your original Android game.
You can easily come up with a cross-IDE solution using makefiles. I guess cmake could help you here.
You could try out MPC. It can generate VS solutions or Eclipse CDT projects(and some more). I've been using it at my previous job and it's really neat once you get the hang of it(which shouldn't be very hard). I'm not sure how well does it work in a
cross-compilation environment, as we were using it to build our project on PC for Linux/Windows.
There's no reason why you shouldn't be able to use Eclipse on WIndows as well.
As far as I know though (I haven't used Eclipse for C++ that much), Visual Studio still has the best debugger. (it can also be a good code health check to compile it with more than one compiler). So there may be reasons to go with VS as well.
If you do decide to go with VS for the Windows version, you may want to look into CMake for managing the build system, since it can generate Visual Studio solutions as well as makefiles and pretty much anything else you may need to build.

Optimal Eclipse CDT (C++) experience in March of 2010

I am a student who will be using C++ next quarter. I really enjoyed using the Galileo release of Eclipse with Java and I would like to continue using Eclipse for for C++ development.
I am now experimenting with C++ development on Eclipse. I am running Eclipse 3.5 SR2 with CDT 6.02. My operating system is Windows 7 and I have installed MinGW-5.1.6. Version 6.3 of GDB is installed.
I have it compiling and stepping through code. However, I have the suspicion that I'm just crawling along and have yet to "shift the car out of first gear". I've spent about a week poking around on the Web to learn what constitutes and "optimal" C++ Eclipse experience. In particular, I'm interested in round-tripping with UML and unit testing.
My exploration of the Web became an archeological dig. I turned up how-to articles from 2003, alternative MinGW distros, references to plugins, dead-links, more references to plugins, passionate discussions on gdb bugs, and more references to plugins.
I no longer have any idea what might constitute an optimal C++ Eclipse environment. Would members of the community like to weigh-in on what they consider to be the current optimal experience for C++ development using Eclipse?
CDT 7.0 (out now in June) will have a preview of Codan, a static analysis framework for C/C++. It will highlight logic errors for you in "realtime", i.e. without having to wait for compilation. (It doesn't have very many checkers at the moment, but the number is growing, and you can also implement checkers of your own.)
CDT 7.0 also features a new debugger contributed by Nokia (called "EDC"), which allows debugging without relying on 3rd party tools such as gdb. This will also allow debugging of Visual Studio binaries, something which previously has been impossible.
The "Open Type" and "Open Resource" commands of CDT (and JDT also, BTW) is something I always miss when I have to do stuff in Visual Studio. Being able to locate any type by incrementally typing a part of its name is very practical, and Visual Studio has nothing close to it.
Integration with unit-testing is still missing, though. Not sure why that hasn't caught on.
Here is what I ended up with for a C++ development environment on Windows 7.
Compiler & libraries
Nuwen MinGW Distro.
It includes the Boost libraries which are necessary for the unit testing framework.
A big thanks to Stephan T. Lavavej for making this distribution available.
Debugger
The GNU debugger as built for Windows.
I copied the file gdb.exe into my C:\MinGW\bin folder and it worked well.
Thanks for Equation Solution for providing win32 and win64 binaries of the GDB executable.
IDE
Eclipse IDE for C/C++ Developers.
Unit testing framework
CUTE (C++ Automated Unit Testing Easier).
Download the Eclipse plug-in using Eclipse’s software installation . Add this URL to “Available Software Sites”: http://ifs.hsr.ch/cute/updatesite.
The CUTE Website has excellent installation and usage instructions.
I failed to find a round-trip modeling tool that was useful to me. Exploring free UML tools was like wandering through a city that had been bombed. Dozens of projects stood in various states of usability. Some projects were clearly active, some were clearly abandoned, but most were somewhere in between. Visio continues to be my pragmatic choice for creating UML models.
Seeing as none of the C++ gods here on SO have weighed in...
My last experience with CDT was about 1 year ago. I too love eclipse for Java, and while CDT "did the job", I didn't feel like it did it any better than Code::Blocks which I used for cross platform development.
Eclipse does have access to UMLet which is my favorite UML tool as it uses a very simple scripting language instead of the 'mouse-click-drag-double-click-type' hell that most UML applications turn out to be. However, UMLet can also be used as a standalone application which makes tucking it into eclipse accomplish little more than wasting screen real-estate.
In the end, I really don't think you are going to find many professionals developing in CDT.
On the linux side you are going to find developers using what they wish to use (Anjuta, Code::Blocks, Dev-C++, kdeveloper, EMACS, vim, etc.)
On the Windows side you'll find Visual Studio overwhelmingly followed by the IDE's above that happen to be cross platform.
In the end, if I HAD to develop in Eclipse; I would use CDT, UMLet, and Subclipse. After having done that I would probably long for my TortoiseSVN, Visual Studio, Code::Blocks, and UMLet standalone.
As far as any automated unit testing goes? Don't know, write my tests by hand. Hope that helps.

Ubuntu desktop development environment (GNU tools)

I am setting up a Linux development machine (Ubuntu 9.0.x).
I want to know the best development environment for a C++ developer on Ubuntu - giving my background (see below).
5 years+ C++
5 years Visual Studio
Not much experience using GNU tools (GCC, GDB, make, etc.)
6 months or so of using Emacs at university (about 8 years ago!) - I don't remember anything though ;)
I come from a Windows background so am more at ease with GUI than CLI, although I expect to learn the CLI commands over time. I want to be effective and "hit the ground running" as it were, in terms of developing on Linux.
I am particular interested in tools that will make my life easier for:
1). project management
2). build configuration via GUI (rather than makefile editing - at least for now).
3). debugging IDE that allows me to set breakpoints and step in/out/over
It would be useful if the IDE suggested has a GUI to ease my transition to Linux, but is also customisable (e.g. can accept hand crafted edited make files etc. - when I have learnt how to create them). This will allow me to have more control over the build process later on.
Which set of tools would you recommend in order for me to achieve the maximum productivity in the minimum amount of time on my Ubuntu desktop?
So:
Which application (IDE) offers:
(i). easiest transition from Visual Studio (and ideally can use manully crafted make files)
(ii). extensive debugging capability akin to Visual Studio
for the latest Ubuntu (9.0.x) desktop OS?
As for C++ developing I'd choose Qt Creator IDE for easiest migrating from Visual Studio. I believe it can cover all your needs.
The best tools that you need are:
make
gcc
g++
Your Favorite Text Editor
auto-tools
Qt Creator
Glade
Your Favorite Project Manager
For Ubuntu I suggest you to use Glade, because Ubuntu uses Gnome(GTK).
About IDEs:
Eclipse For C/C++
Netbeans For C/C++
Code::Blocks
Kdevelop
I think you should just bite the bullet and learn enough make, gcc, and gdb to accomplish what you need to do at the command line. If you get that taken care of, you can use whatever editor you like to write the code -- even Visual Studio's editor.
Have a look at Code::Blocks. It's a nice IDE for doing C/C++ and comes with an own build-system. But be sure not to grab the version inside the official ubuntu repository but go to the CB forum and look for the latest nightly build. There are people maintaining repositories with ubuntu packages. I think CB is worth the hassle of installing the latest version.
Link to Code::Blocks Forum
Btw. I did an install some days ago. There are two people maintaining 64-Bit Ubuntu packages. Only one did work, though. It was this one.
You can use Glade Interface designer (glade.gnome.org) for interface design.
BOUML for UML modelling & project management
You can always use eclipse or netbeans for c++ development on linux.
Though I recommend Eclipse, it would automatically generate makefiles, debugging is very easy & you can configure your code repositories within the IDE.