473,410 Members | 1,916 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,410 software developers and data experts.

cygwin and visual studio.

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?


Jul 19 '05 #1
2 12419
> How do I resolve the conflict between
the two systems?


Use Emacs.

Jack

Jul 19 '05 #2
Hi JustSomeGuy,

"JustSomeGuy" <no**@nottelling.com> 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.


Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bastien Continsouzas | last post by:
Has anybody managed to build a Php Extension (Loadable Module) under Cygwin. I tried to build the example first_module found on http://www.zend.com/zendapi. It compiles and works well under linux....
0
by: Bastien Continsouzas | last post by:
Has anybody managed to build a Php Extension (Loadable Module) under Cygwin. I tried to build the example first_module found on http://www.zend.com/zendapi. It compiles and works well under linux....
2
by: Jorgen Grahn | last post by:
I couldn't think of a good solution, and it's hard to Google for... I write python command-line programs under Win2k, and I use the bash shell from Cygwin. I cannot use Cygwin's python package...
0
by: dw | last post by:
Pehaba, does anyone knows how to install MySQLdb on cygwin? - test device: MySQLdb 0.9.2.0 targz + cygwin 1.5.7-cr-0x9e + python 2.3.3 on cygwin + mysql 4.0.17 win32 - modified setup.py's...
2
by: 63q2o4i02 | last post by:
Hi, I'm using python 2.4 and windows XP. I have two packages in the windows version of python in site-packages. They are PyVisa and ctypes, and both live in c:\python24\lib\site-packages ...
1
by: Panagiotis | last post by:
Hi everyone, this is what I want to do in C#: 1) start a Cygwin Bash Shell 2) send the Shell a command, for example "ls -l" 3) capture all the output of the command The code below seems to...
16
by: Micko1 | last post by:
Hello there :) I have been using Visual Studio on a program which I have just completed, however I need to have it compiling using a unix based compiler, when I try in cygwin, I get the following...
0
by: dot | last post by:
I spent a few headache filled days trying to use GMP on windows (XP pro) I finally got it to work and since I found little help on the Web I thought someone might find what i did useful. ...
5
by: broli | last post by:
and then learn C language ?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.