Is it possible to run Linux C network program can run on MS Dos...

Dear friends...

      I wrote network program in Linux C Programming. now i like to run it on Windows (Ms dos). i have a compiler djgpp. But i didnt compile socket system calls... I copied that header file from linux to windows and also PATH.

      Plz help me to solve this problem...

urs
prakash
haiprakashAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

akshayxxCommented:
not the linux socket program will not compile/run on windows as it is .. and header files are nuthing but prototype of function calls..
u'll need the socket library.. and for windows it is called winsock.. look for tutorials on web .. how to write sample network programs using winsock
0
akshayxxCommented:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcecomm/htm/_wcesdk_winsock_sample_applications.asp

follow the above link for sample applications using winsock..

which windows version are u using .. i hope its not MSDOS?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
BabuPrasannaCommented:
Just create "console application" project in the VC++ and add the files to it. Now u need to add the ws2_32.lib to your project(Add files to project option).And #include<winsock2.h> at the start instead of all the <sock.h> etc..etc.. I had assumed that you have used the POSIX standards for coding.

Now Call the WSAStartup() function before any of the network calls(socket,connect..etc..etc)and call any of your designed function. Refer MSDN for the WSAStartup() function.
Windows has support libraries for the unix to windows portability of network programs.

Now compile the code and run!

Remember, a code generated(exe) for one OS can never work in any other OS by just replacing the ".h" files. You need to recompile them with the corresponding .lib and .h files.
0
jmcgOwnerCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: akshayxx {http:#7991670} & BabuPrasanna {http:#8007024}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux OS Dev

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.