Shell
Shell

Reputation: 6849

Can i create application in Windows for Linux platform?

I have around of 4 years experience in C#.Net programming and i am developing a client server application. The server application will be insalled on CentOS and client application will be installed in Windows OS. But, i don't have much knowledge about c++ programming on linux platform. So, my question is that can i create a console application in Windows OS and compile it for linux platform. it is not necessary that compile it on Windows. but, it should be executed in linux platform. I am new in linux programming.
Presently i am using TC++ editor. Can i use Visual Studio 2010 to build server application for linux platform?

if there are another approach then please suggest me.

Thanks.

Upvotes: 0

Views: 204

Answers (2)

edmz
edmz

Reputation: 8492

You can develop the client in C# and the server in C++, if you prefer. Consider that unlike C#, there is no standard socket library yet, and you'll have to rely on either system calls or their higher level wrappers (like boost).
I've to tell you that Windows uses BSD sockets (its own version, with some modifications though), therefore with a few preprocessors checks, you can make your application portable.

In your case, I'd suggest you to go for boost.asio which will hide all low-level stuff for you. It's even cross-platform.

Upvotes: 1

Alex Punnen
Alex Punnen

Reputation: 6244

Maybe you can use VS as an editor ; Make sure that you do not include any windows specific libs; There is an option of using cygwin and doing a cross compilation. Check the links How to cross compile from windows g++ cygwin to get linux executable file

I guess it will be more of a pain. Better use Virtual Box --> linuxMint/Ubuntu + Eclipse with C++ plugin or some other C++ editor...

Upvotes: 1

Related Questions