Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, What would be the easiest way of developing a multi-OS application in C using sockets on Linux and winsock on windows? And this may be useful if i could ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2003
    Location
    UK
    Posts
    9

    C sockets and Winsock


    Hi,

    What would be the easiest way of developing a multi-OS application in C using sockets on Linux and winsock on windows? And this may be useful if i could apply your technique to other libraries etc. Any variables can be set at runtime. Thanks in advance.

    Kind Regards
    Mark Rawson

  2. #2
    Linux Engineer kriss's Avatar
    Join Date
    Jun 2003
    Posts
    1,113
    Correct me if I'm wrong but isnt the syntax the same, or very much the same? If yes, then can't you just use

    #ifdef win32
    // your code
    #endif

    etc etc?


    Or you can place the windows code there, and the GNU/Linux code in another ifdef?

    Hope I understood things correctly

    Good luck

  3. #3
    Just Joined!
    Join Date
    Sep 2003
    Location
    UK
    Posts
    9
    hmm..I suppose that would probably be the best solution for this particular situation. Thanks, as you can probably guess i've only been learning C for a few days so i only knew #include .

    Kind Regards
    Mark Rawson

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •