Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > cygwin and visual studio.

Reply
Thread Tools

cygwin and visual studio.

 
 
JustSomeGuy
Guest
Posts: n/a
 
      11-13-2003
I'm writing a socket class using unix flavor sockets. I'm developing on
win2k with M$ visual studio 6.0.
I have cygwin installed and would like to use its socket header files:

#ifdef UNIX
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#else // Windows.
#include </cygwin/usr/include/sys/types.h>
#include </cygwin/usr/include/sys/socket.h>
#include </cygwin/usr/include/netinet/in.h>
#endif

Now MS has types defined so I've made sure that the cygwin types is used.

My question is:
1) Should I have simply set up an include search path to cygwin for
types.h,socket.h and in.h?
2) cygwin includes _ansi.h which is also in /cywin/user/include so I guess i
need that in my include search path. How do I resolve the conflict between
the two systems?




 
Reply With Quote
 
 
 
 
Jack Adam
Guest
Posts: n/a
 
      11-13-2003
> How do I resolve the conflict between
> the two systems?


Use Emacs.

Jack

 
Reply With Quote
 
 
 
 
Ekkehard Morgenstern
Guest
Posts: n/a
 
      11-13-2003
Hi JustSomeGuy,

"JustSomeGuy" <(E-Mail Removed)> schrieb im Newsbeitrag
news:wASsb.383779$pl3.349141@pd7tw3no...
> 2) cygwin includes _ansi.h which is also in /cywin/user/include so I guess

i
> need that in my include search path. How do I resolve the conflict

between
> the two systems?


The best solution would be to use Cygwin's C++ Compiler (GCC, "g++" command,
use the Cygwin command line window to compile).

Using Visual C++ with the Cygwin libraries and includes might not work
(since they're designed for GCC). The Visual C++ linker does understand the
UNIX library formats, however. In your project settings or compiler/linker
command line options, you have to turn off default library and include path
search and point those to Cygwin's directories.

Another option is to use the WinSock1 interface (declared in WinSock2.h,
documented in the Windows API documentation that came with Visual C++ or in
the Platform SDK). It is roughly compatible with the UNIX interfaces, might
require some conditional code though, especially select() calls are handled
a bit differently than on UNIXes. This way, there'd be no need to use the
Cygwin libraries or includes.

I hope that helps.

Regards,
Ekkehard Morgenstern.




 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FREE E - BOOK Available Now for Free MCAD/MCSD Training Guide (70-315): Developing and Implementing Web Applications with Visual C# and Visual Studio.NET by Amit Kalani (Paperback) BOGABOGA MCAD 12 04-21-2005 01:13 PM
confirm unsubscribe from cygwin@cygwin.com cygwin-help@cygwin.com Python 0 09-05-2003 04:42 PM
WELCOME to cygwin@cygwin.com cygwin-help@cygwin.com Python 1 09-05-2003 07:46 AM
confirm unsubscribe from cygwin-announce@cygwin.com cygwin-announce-help@cygwin.com Python 0 09-05-2003 01:29 AM
confirm unsubscribe from cygwin@cygwin.com cygwin-help@cygwin.com Python 0 09-04-2003 06:34 PM



Advertisments