473,569 Members | 2,400 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 12425
> How do I resolve the conflict between
the two systems?


Use Emacs.

Jack

Jul 19 '05 #2
Hi JustSomeGuy,

"JustSomeGu y" <no**@nottellin g.com> schrieb im Newsbeitrag
news:wASsb.3837 79$pl3.349141@p d7tw3no...
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
1655
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. Under windows with Apache 2.0.48, I managed to compile it using cygwin compiler but I have the following message : Warning: dl(): Unable to load...
0
738
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. Under windows with Apache 2.0.48, I managed to compile it using cygwin compiler but I have the following message : Warning: dl(): Unable to load...
2
14344
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 because of a binary module which has to be compiled with Visual C 6. My scripts start with a '#!/usr/bin/env python' shebang, as God intended. ...
0
2321
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 using thread library.. NO, library + include
2
3208
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 I'd like to move these to the cygwin version of python on the same system. I tried copying the PyVisa and ctypes directorices (including
1
11627
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 work when I there isn't alot of output to capture, but when the output increases, the code will freeze.
16
43687
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 error: undefined reference to `_WinMain@16' I have tried searching for a workaround, although I am not a programming guru, and I find it...
0
3275
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. Creating an environment suitable for GMP programming. 1) Create 'cygwin' environment (see below) 2)add GMP to the cygwin directory (see below)
5
1596
by: broli | last post by:
and then learn C language ?
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8138
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7679
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5223
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2117
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1228
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.