开发者

Developing Linux software on Windows

I want to write software for the Linux platform, but I would like to do this on a Windows OS. I'm only developing Linux software for a remote server of mine, so it wouldn't be worth it to switch to Linux ju开发者_开发问答st for that. I don't think it's as simple as using a cross-compiler, because I will be writing code that uses headers specifically for Linux, and I would like to test the programs on Windows. I don't want to use VirtalBox etc.


If possible, install the entire development environment on the linux server. Then install an Xserver (e.g XMing) and an ssh client (e.g putty) on your Windows box. Then run the dev. environment remotely.

The big pro of doing this is that the linux windows integrate seamlessly in the Windows enviornment. I used to work with dual platform development and had a virtual linux box on my PC. Still, I used ssh+X-forwarding to access it. This way I got full copy-paste support etc. between the environments.


Now WSL (also known as "Bash on Windows") exists, you can run native Linux binaries directly on Windows. With snapcraft you can package Linux applications entirely under Windows, without using a VM. Might be a better option. I made a super quick video to explain it.


CoLinux allows you to run linux side-by-side with Windows.


You could try VirtualBox and virtualize a Linux environment from within Windows. I do the reverse of what you are trying to do and run Windows from Linux, and it works quite well.


If you are familiar with .NET and C# you can use Mono for your client.

You can use Visual Studio to develop and the Mono runtime one Linux to run the application.

You do need to keep away from windows specific code.


Maybe Cygwin could help. You don't need an entire virtual machine and only the api is emulated.


You could use g++ in cygwin to target a linux binary. It's a pain to setup as you noted you'll need the entire toolchain (not just the compiler). I've used crosstool (domain name makes me giggle every time) in the past with success. It looks like someone did the work already http://metamod-p.sourceforge.net/cross-compiling.on.windows.for.linux.html

However I've never targeted linux from windows. I'd install a virtual linux box, way easier and you're likely going to want to do your testing on a real linux box before going live.

Cygwin isn't linux so you can't test your linux binaries there.

Out of curiosity what's keeping you from doing the development on linux? If the server the app runs on isn't mission critical you could even develop there.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜