?
Solved

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

Posted on 2003-02-20
5
Medium Priority
?
196 Views
Last Modified: 2010-04-22
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
0
Comment
Question by:haiprakash
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 8

Expert Comment

by:akshayxx
ID: 7991666
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
 
LVL 8

Accepted Solution

by:
akshayxx earned 200 total points
ID: 7991670
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
 

Assisted Solution

by:BabuPrasanna
BabuPrasanna earned 200 total points
ID: 8007024
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
 
LVL 20

Expert Comment

by:jmcg
ID: 9983372
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

Featured Post

Understanding Linux Permissions

Linux for beginners: How to view the permissions associated with files and directories and also how you can change them.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question