Can I remotely debug a linux machine from VS2005? - linux

I am developing a cross-platform application in C++ in VS2005. I already know how to run a remote process on a windows box, attach it, and debug from my VS.
Is there a way to do debug a running process on Linux for example? What about other *nix platforms such as Solaris or AIX? I can do emacs+gdb, but if this can be done from VS I'd prefer that.

VS2005 and g++ use create completely different debugging symbols. You do realize you'll have to compile the application on linux with g++? (or some other *nix compiler, but not VS2005). So because it's compiled with a different compiler, there's really no way to debug it inside VS2005.
OK, everything I said was essentially true, but it looks like there is a program that will allow you to run gdb inside Visual Studio. Check it out here.

Related

How to build Visual C++ apps on Linux that use Windows headers?

I've seen several tutorials on how to compile C++ applications for Windows on a linux system, however, I have failed to find a way to use Windows specific headers (i.e Windows.h) in my C++ program to compile for Windows (.exe/.dll). I was wondering if anyone knew how I can compile Visual C++ programs on Linux that use Windows OS Specific headers/functions (just compile). Thanks!
You can't. Windows system headers, e.g. windows.h reference OS specific APIs that are not known to Linux. Only Microsoft's compiler can create Windows format objects and executables and it doesn't run on Linux.
You can create cross-platform applications consisting of common code that will build and run on Windows and Linux. But the only way to use platform specific APIs in such an application, e.g. GUI, is to #define sections in/out according to the build environment.

Can one compile Windows code on Linux?

I have an Ubuntu server (with a VPN and a samba share), where I store all my project files and so on.
I would like not to have to back up the files I have on my computer to the server, but instead, directly use the files that are on the server.
But, when I want to build a project on Windows, it gets really slow, since I basically have to be transferring that whole bunch of files visual studio creates through the internet, so I can build the project.
The core concept is:
Open files that are on the server and use them (ie. saving one file at a time is fast enough not to make a difference).
Compile the code on Linux (Maybe code a VS extension with sockets that will tell the server to build, and that server-side, when done building, will send a message back, for VS to run and debug the program). Which would be much better since my laptop is nothing compared to the server performance-wise.
Run and debug the program with VS on windows.
I've so far only been able to find this(which is not what I want because it uses g++, and I'd like VC++) and this(which is not what I want because it's compiling for linux and executing it remotely). What I'm looking for is a mixture of both.
Remote compiling, local programming and executing.
Would also be great because supposedly, I could build with whatever VC++ version I wanted with whatever SDK I wanted. So I could basically easily switch between compiling for Windows 7 and 10.
I'd just like to know: Is it possible to achieve that? And if so how?
Using VC++ directly on Linux is not possible.
To let the Linux server do the compiling with VC++ anyway you could either use wine which apparently works with older Versions (see https://appdb.winehq.org/objectManager.php?sClass=application&iId=5766
) but propably is not easy to set up in a CLI envrioment and might cause License Issues with Microsoft, or use Windows Virtual Machines, which tend to have some Performance drawback.
The best Solution would be to use GCC (g++), which works on a wide range of architectures and operating systems and supports cross compiling.

Deploy to Linux

Background:
Im using QT and have visual studio 2012 as my IDE (used the QT plugin for visual studio).
And finally the whole project is done. However due to my .NET background I have no experience when it comes to deploying my project so it can be run on Linux.
Question:
Anyone knowing how to deploy a QT project made in visual studio to linux?
You should install Linux and prepare a Qt development environment on it.You can then copy your project there, compile it and see the results in the real environment. This way you can cope with the minor differences when porting from one OS to another easily.
So don't think of cross compiling your app for Linux on Windows. From a complexity point of view, I think setting up a Linux machine (VM or not) and the necessary environment for Qt is a whole lot simpler than cross compiling bug hunting afterwards. After all you will need a real target environment to finally test your application.
Before you can deploy something you have to compile it for that platform, and here you have two main choiches: either you cross-compile which means you compile it on windows using a set of tools so that your software is built to run on a linux, or you get a linux machine, you copy your entire project over and let Qt for linux do the magic.
Once you have your working binary compiled on linux or for linux then you start thnking about deployoment.
If you really want to be fully linux-compatible and "linux-ally correct" you should distribute your source-code precooked using some tools like "automake" that will make it possible to linux users to compile it on any linux version.
If you do not want to release your source code, you technically can distribute binaries without source code (not sure if you will be ok with licenses) but you have to be aware that there is no standard in linux for distributing binary packages, there are at least 2 main package building standards that are the ubuntu/debian style and red hat (and friends) style.
You are going to find plenty of documentation about all this stuff from cross-compile to automake and of course building debian packages and building red hat rpm packages.

Qt Creator as a debuging system for Linux embedded

In our system, we write the code on C++ without using Qt libraries.Actually, we write the on Windows machine, but finaly, this code must to be rebuilded for Linux Embedded machine. At first stage we did it successfully with Makefile-s, but "old style debugging" with gdb utility killed us. So I want to use Qt Creator to debug the application.
I successfully use Qt Creator to build all libraries and applications for ARM machine(of couse I have an ARM toolchain). But I cannot remotely debug the system.
I do not understand, what I do wrong.
The questions:
1. For system debuging, do I need Qt Libraries buld for ARM machine? (as I wrote above, I do not use Qt Libraries for my applications or for my libraries)
2. Do I need to redefine Mkspec for ARM compiler?
Thanks, Slava
You generally don't need Qt libraries for your system to use Qt Creator as a debugger frontend for your plain C++ program on an embedded device. However, if you use qmake as a build system, the associated Qt version must (roughly) match your target.

Generate Linux executable on QtCreator

I'm working under Windows and I'm looking for a simple solution that could make me able to cross compile for both Windows and Linux.
I've found this topic :
But the reference of the answer is broken and I don't understand it very well.
I'm using QtCreator and what I want is a kit with something that gives me a Windows executable and another kit with which I would have a executable for Linux.
So far I've been using the Visual Studio compiler MSVC on one kit. That gives me a compilation for Windows.
I'm using MinGW with GCC on another kit. I hoped it could give me a Linux executable. But this gives me a Windows executable too.
How can I get a compiler that could work under QtCreator on Windows and generate Linux executable ?
I've found a solution a long time ago so I'm posting it. Maybe it could be useful.
I've used Cygwin and Crosstools. This makes me able to cross-compile for Linux while being under Windows.

Resources