I wanted to know if it is possible to write and debug a C++ application for Linux in Windows using Eclipse? If so could you point me in the right direction for configuring Eclipse?
Thanks
I wanted to know if it is possible to write and debug a C++ application for Linux in Windows using Eclipse? If so could you point me in the right direction for configuring Eclipse?
Thanks
If you are looking for a "magic" plugin in Eclipse that lets you develop Linux software in Windows, such a thing does not exist.
To make a Linux executable, you need to compile your code on Linux. (There are cross compilers, but I doubt there is a Linux compiler for Windows.)
If you write your code portable, you definitely could develop on Windows and then compile your code on Linux. Stick with portable libraries (STL, boost, etc..), and you should be good. It doesn't matter what IDE you use for this.
This link of the Ecpise CDT's tema leader can be interesting:
http://cdtdoug.blogspot.com/2008/10/windows-as-host-for-linux-development.html
I believe it may be possible.
You should configure Eclipse to use Cygwin's toolchain:
http://www3.ntu.edu.sg/home/ehchua/programming/howto/Eclipse_cpp_HowTo.html
http://www3.ntu.edu.sg/home/ehchua/programming/howto/Eclipse_cpp_HowTo.html
To compile it, you need a cross-compiler chain, e.g from cygwin. Also there are some "development kits" available for some Linux distributions. (especially for embedded).
To DEBUG the application, you need to run the application on the linux target and use "gdbserver" to allow remote debugging.
Starting gdbserver is simple, it needs a connection tty (serial device, usb, network) and can attach to a running PID. So to attach to your programm "myProg" and make gdbserver listen on port 6000 just use
gdbserver :6000 --attach
pidof myProg
(Edit: Please note that there are "backticks" around pidof myProg, but I don't know how to escape them, so stackoverflow don't recognize this as formatting).
on the target.
On the Windows host you also need an gdb (it should come together with your cross-compiler). Then you can use Eclipse to start remote debugging and connect to Linux target.