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

error compiling with read function

Hi,
I have this thread function:
//handle one socket connection thread
DWORD WINAPI SocketHandler(LPVOID lpvParam)
{
int socketNumber=*(DWORD*)lpvParam ; //the socket number
int n;
char end_connection[]={"$Exit$\n"}; //end connection message
char buffer[BUFSIZE];

n = read(socketNumber,buffer,BUFSIZE);
if (n < 0) //error reading
exit(1); //exit thread

while(strcmp(buffer,end_connection)) //until end connection has
reached
Message* x=new Message(buffer);

return 0;
}

for some reason I get the following error :
error C3861: 'read': identifier not found, even with argument-dependent
lookup

this happens using vs.net 2003 enviroment for win32 console
application.
I have the following declerations at the top of the file:
#include <iostream>
#include <winsock.h>
#include <windows.h>
#include "Message.h"
#include "MessageQueue.h"

using namespace std;
#pragma comment(lib, "ws2_32.lib")

Any idea what the problem might be ?

Jan 9 '06 #1
4 2872
Shlomy Shivek wrote:
Hi,
I have this thread function:
//handle one socket connection thread
DWORD WINAPI SocketHandler(LPVOID lpvParam)
{
int socketNumber=*(DWORD*)lpvParam ; //the socket number
int n;
char end_connection[]={"$Exit$\n"}; //end connection message
char buffer[BUFSIZE];

n = read(socketNumber,buffer,BUFSIZE);
if (n < 0) //error reading
exit(1); //exit thread

while(strcmp(buffer,end_connection)) //until end connection has
reached
Message* x=new Message(buffer);

return 0;
}

for some reason I get the following error :
error C3861: 'read': identifier not found, even with argument-dependent
lookup

this happens using vs.net 2003 enviroment for win32 console
application.
I have the following declerations at the top of the file:
#include <iostream>
#include <winsock.h>
#include <windows.h>
#include "Message.h"
#include "MessageQueue.h"

using namespace std;
#pragma comment(lib, "ws2_32.lib")

Any idea what the problem might be ?


This question is off-topic here since it doesn't deal with the standard
language or libraries proper. See the FAQ for what is on-topic and for
some suggestions of better places to post:

http://www.parashift.com/c++-faq-lit...t.html#faq-5.9

Cheers! --M

Jan 9 '06 #2
Shlomy Shivek wrote:
Hi,
I have this thread function:
//handle one socket connection thread
DWORD WINAPI SocketHandler(LPVOID lpvParam)
{
int socketNumber=*(DWORD*)lpvParam ; //the socket number
int n;
char end_connection[]={"$Exit$\n"}; //end connection message
char buffer[BUFSIZE];

n = read(socketNumber,buffer,BUFSIZE);
if (n < 0) //error reading
exit(1); //exit thread

while(strcmp(buffer,end_connection)) //until end connection has
reached
Message* x=new Message(buffer);

return 0;
}

for some reason I get the following error :
error C3861: 'read': identifier not found, even with argument-dependent
lookup

Any idea what the problem might be ?


Well, all I can tell you is the same as the compiler.

read is not declared.

Read the API for your library, or ask in a more appropriate place.
Presumably you have the wrong argument types, or have not included the
correct header.

Ben Pope
--
I'm not just a number. To many, I'm known as a string...
Jan 9 '06 #3

"Shlomy Shivek" <sh**********@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Hi,
I have this thread function:
//handle one socket connection thread
DWORD WINAPI SocketHandler(LPVOID lpvParam)
{
int socketNumber=*(DWORD*)lpvParam ; //the socket number
int n;
char end_connection[]={"$Exit$\n"}; //end connection message
char buffer[BUFSIZE];

n = read(socketNumber,buffer,BUFSIZE);
if (n < 0) //error reading
exit(1); //exit thread

while(strcmp(buffer,end_connection)) //until end connection has
reached
Message* x=new Message(buffer);

return 0;
}

for some reason I get the following error :
error C3861: 'read': identifier not found, even with argument-dependent
lookup

this happens using vs.net 2003 enviroment for win32 console
application.
I have the following declerations at the top of the file:
#include <iostream>
#include <winsock.h>
#include <windows.h>
#include "Message.h"
#include "MessageQueue.h"

using namespace std;
#pragma comment(lib, "ws2_32.lib")

Any idea what the problem might be ?


I beleive you want recv, not read.
Jan 12 '06 #4
That is right, thanks!

Jan 13 '06 #5

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

Similar topics

0
by: PiErre | last post by:
Hi All, I am trying to install win32 extension 162 on python 2.2.3 on a virtual (vmware) machine with win2k server sp3 (but I tested that the same happens on either win2k sp2 or win2ksp3 on a...
8
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the...
12
by: mast2as | last post by:
Hi everyone... I have a TExceptionHandler class that is uses in the code to thow exceptions. Whenever an exception is thrown the TExceptionHander constructor takes an error code (int) as an...
2
by: teddybyte | last post by:
my script below is: #include "stdafx.h" int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, ...
2
by: f rom | last post by:
----- Forwarded Message ---- From: Josiah Carlson <jcarlson@uci.edu> To: f rom <etaoinbe@yahoo.com>; wxpython-users@lists.wxwidgets.org Sent: Monday, December 4, 2006 10:03:28 PM Subject: Re: ...
2
by: 001 | last post by:
I get the following error when compiling under MS VC++: ------ Build started: Project: pract-1, Configuration: Debug Win32 ------ Compiling... pract-1.cpp Linking... atlsd.lib(atltrace.obj) :...
7
by: JustBeSimple | last post by:
Hi Everyone, I'm having a problem compiling useing the VS2005 .NET I need help to resolve those error, I try to create a new project it doesn't help any suggestion? I got the following errors:...
1
by: sahilrekhi | last post by:
Hi i am working on a graphical user interface deisgn programme. when i compile the file i i get the following output with the mentioned errors: 1>------ Rebuild All started: Project: guiq,...
8
by: jadamwil | last post by:
Hello, I am using the numpy fromfile function to read binary data from a file on disk. The problem is that the program runs fine on a Mac, but gives an error or warning on windows when trying to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
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.