473,387 Members | 1,641 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,387 software developers and data experts.

Socket programming using Visual C++ .Net

Hello,

I am trying to compile a class that uses socket using the Visual C++
..NET compiler. I get the following error:

------ Build started: Project: infCommon, Configuration: Release Win32
------

Compiling...
cl : Command line warning D4029 : optimization is not available in the
standard edition compiler
infSocketObject.cxx
c:\ILS\inFACT\Common\infSocketObject.h(4) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or directory
infServerSocketObject.cxx
c:\ILS\inFACT\Common\infSocketObject.h(4) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or directory
infObjectUsingSocket.cxx
c:\ILS\inFACT\Common\infSocketObject.h(4) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or directory
infClientSocketObject.cxx
c:\ILS\inFACT\Common\infSocketObject.h(4) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or directory
Generating Code...

Obviously, the #include<sys/socket.h> is the issue... but why is that
??? Is it because Visual C++ .Net does not support standard socket
programming ??? I actually checked in the include directory of Visual
C++ .NET and was unable to find any trace of the socket.h file.

Any help would be appreciated.

Regards,

Jean-Philippe
Jul 22 '05 #1
2 13713

"Jean-Philippe Guyon" <pi****@yahoo.fr> wrote in message
news:28**************************@posting.google.c om...
Hello,

I am trying to compile a class that uses socket using the Visual C++
.NET compiler. I get the following error:

------ Build started: Project: infCommon, Configuration: Release Win32
------

Compiling...
cl : Command line warning D4029 : optimization is not available in the
standard edition compiler
infSocketObject.cxx
c:\ILS\inFACT\Common\infSocketObject.h(4) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or directory
infServerSocketObject.cxx
c:\ILS\inFACT\Common\infSocketObject.h(4) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or directory
infObjectUsingSocket.cxx
c:\ILS\inFACT\Common\infSocketObject.h(4) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or directory
infClientSocketObject.cxx
c:\ILS\inFACT\Common\infSocketObject.h(4) : fatal error C1083: Cannot
open include file: 'sys/socket.h': No such file or directory
Generating Code...

Obviously, the #include<sys/socket.h> is the issue... but why is that
??? Is it because Visual C++ .Net does not support standard socket
programming ??? I actually checked in the include directory of Visual
C++ .NET and was unable to find any trace of the socket.h file.

Any help would be appreciated.


Your question is not about ISO standard C++, the only topic here.
You need to ask about this in a Visual C++ newsgroup, e.g.

microsoft.public.dotnet.languages.vc

If your news server does not have this group, connect your news
reader to Microsoft's public news server, msnews.micorosoft.com

Purpose of comp.lang.c++:
http://www.slack.net/~shiva/welcome.txt

-Mike
Jul 22 '05 #2
Hello Jean-Philippe,

you are right when you say that including <sys/socket.h> is the
problem. This is the header file used for *nix based systems. Windows
has implented their own version very similar to the BSD sockets API.
The include file for this is simply <winsock2.h>. You will also have
to link the WS2_32.lib to your program. This can be done in the
project settings menu. Another issue of importance is the way that
the API is implemented. Even though it is very similar to coding
sockets on other systems, it still has its differences. For example
you must call WSAStartup() before you even call socket(). Once you
see the code however you should be more than comfortable with coding
sockets in windows. Just search the web and you'll find what you
need.

Good Luck,
Kevin Mooney
Jul 22 '05 #3

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

Similar topics

5
by: John Sheppard | last post by:
Hi all, I am not sure that I am posting this in the right group but here it goes anyway. I am new to socket programming and I have been searching on the internet to the questions I am about to pose...
9
by: Michael Lindsey | last post by:
I need to write a server app to send images to client GUIs that are outside of the server's domain. The client will have the file system path to the image but can not access the file system. I am...
2
by: Sandy | last post by:
Hi All, I'm a newbe to socket programming, I need to work on a project that has to be developed in C++ or Visual C++ ( I have 8.0 version) console application. which will be execute from a Java...
8
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi all, I am new to .net technologies. ASP.NET supports socket programming like send/receive in c or c++? I am developing web-site application in asp.net and code behind is Visual C#. In...
5
by: gnanapoongothai | last post by:
hi, i am a beginner in socket programming in vc++. There is error poping up when the addr of the socket is compling, .\simple_socketsever.c(41): error: identifier "sockaddr_in" is undefined ...
2
by: maxpa1n | last post by:
Hi i am a software developer and i need to use .NET 2.0 with C#. I am using Visual Studio 2005 Professional and Windows Vista Ultimate as the development eviornment. I have a programm that...
0
by: Rii | last post by:
Hi I m bigner in socket programming using asp.net & c#. I hv made one simpl client-server appl'n. hw can I get data(which is sent by srvr/client) in receive textbox(of client/srvr) without...
7
by: nagasrinivas05 | last post by:
hi, this is srinivas here i am using socket programming to send data to a remote computer using clssocket with namespace system.net and it is working well, but when i am sending continuous data in a...
5
by: Radz | last post by:
Make a project that creates a message box with the following features • The text to be displayed on the message box should be Visual Programming First Assignment • Title appeared on the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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...

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.