Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Newbie VC++ 6.0 issues

Reply
Thread Tools

Newbie VC++ 6.0 issues

 
 
w0rd
Guest
Posts: n/a
 
      04-01-2008
Hi guys,
Wondering if you could help me with some errors I've been getting with
the source of a commissioned project. I've got no C++ experience so
I've got no idea what's going on but when I try to compile in debug
mode I get these errors (I've included the lines lines where the
errors happen if it helps):

addrinfo *AI;
\Async.cpp(47) : error C2065: 'addrinfo' : undeclared identifier
\Async.cpp(47) : error C2065: 'AI' : undeclared identifier
\Async.cpp(47) : warning C4552: '*' : operator has no effect; expected
operator with side-effect

if(getaddrinfo(lpszHost, "80", NULL, &AI) != 0)
\Async.cpp(50) : error C2065: 'getaddrinfo' : undeclared identifier

SOCKET s = socket(AI->ai_family, SOCK_STREAM, 0);
\Async.cpp(56) : error C2227: left of '->ai_family' must point to
class/struct/union

if(connect(s, AI->ai_addr, AI->ai_addrlen) == SOCKET_ERROR)
\Async.cpp(63) : error C2227: left of '->ai_addr' must point to class/
struct/union
\Async.cpp(63) : error C2227: left of '->ai_addrlen' must point to
class/struct/union

ULONG (PASCAL *SendMail)(ULONG, ULONG_PTR, MapiMessage*, FLAGS,
ULONG);
\Utils.cpp(257) : error C2143: syntax error : missing ')' before
'__stdcall'
\Utils.cpp(257) : error C2059: syntax error : ')'

(FARPROC&)SendMail = GetProcAddress(hMAPI, _T("MAPISendMail"));
\Utils.cpp(25 : error C2065: 'SendMail' : undeclared identifier

int nError = SendMail(0, (ULONG_PTR)AfxGetMainWnd()->m_hWnd,
&message, MAPI_LOGON_UI|MAPI_DIALOG, 0);
\Utils.cpp(284) : error C2065: 'ULONG_PTR' : undeclared identifier
\Utils.cpp(284) : error C2146: syntax error : missing ')' before
identifier 'AfxGetMainWnd'
\Utils.cpp(284) : error C2059: syntax error : ')'

I've got a feeling some of the errors come from me missing some sort
of global files.
Thanks in advance.
 
Reply With Quote
 
 
 
 
Jim Langston
Guest
Posts: n/a
 
      04-01-2008
w0rd wrote:
> Hi guys,
> Wondering if you could help me with some errors I've been getting with
> the source of a commissioned project. I've got no C++ experience so
> I've got no idea what's going on but when I try to compile in debug
> mode I get these errors (I've included the lines lines where the
> errors happen if it helps):
>
> addrinfo *AI;
> \Async.cpp(47) : error C2065: 'addrinfo' : undeclared identifier


These, and the following errors, seem to be occuring because you're missing
the include of the header file where they are defined. The actual header
file for sockets depends on your OS and compiler. In windows it might be
#include <WinSock2.h> or #include <WinSock.h> or something else.

On Linux I couldn't tell you, check your documentation.

[SNIP similar type errors]

--
Jim Langston
http://www.velocityreviews.com/forums/(E-Mail Removed)


 
Reply With Quote
 
 
 
 
Jim Langston
Guest
Posts: n/a
 
      04-01-2008
Jim Langston wrote:
> w0rd wrote:
>> Hi guys,
>> Wondering if you could help me with some errors I've been getting
>> with the source of a commissioned project. I've got no C++
>> experience so I've got no idea what's going on but when I try to
>> compile in debug mode I get these errors (I've included the lines
>> lines where the errors happen if it helps):
>>
>> addrinfo *AI;
>> \Async.cpp(47) : error C2065: 'addrinfo' : undeclared identifier

>
> These, and the following errors, seem to be occuring because you're
> missing the include of the header file where they are defined. The
> actual header file for sockets depends on your OS and compiler. In
> windows it might be #include <WinSock2.h> or #include <WinSock.h> or
> something else.
> On Linux I couldn't tell you, check your documentation.
>
> [SNIP similar type errors]


My bad. Your post is titled VC++ 6.0 issues. Try
#include <WinSock2.h>
but you really should get away from 6.0 It was made prestandard and has
other issues that'll frustrate you in the future to no end. You can
download a free 2003 C++ from Microsoft although it has no optimizations of
the executable. Or download Dev C++.

--
Jim Langston
(E-Mail Removed)


 
Reply With Quote
 
w0rd
Guest
Posts: n/a
 
      04-01-2008
On Apr 1, 3:05 pm, "Jim Langston" <(E-Mail Removed)> wrote:
> w0rd wrote:
> > Hi guys,
> > Wondering if you could help me with some errors I've been getting with
> > the source of a commissioned project. I've got no C++ experience so
> > I've got no idea what's going on but when I try to compile in debug
> > mode I get these errors (I've included the lines lines where the
> > errors happen if it helps):

>
> > addrinfo *AI;
> > \Async.cpp(47) : error C2065: 'addrinfo' : undeclared identifier

>
> These, and the following errors, seem to be occuring because you're missing
> the include of the header file where they are defined. The actual header
> file for sockets depends on your OS and compiler. In windows it might be
> #include <WinSock2.h> or #include <WinSock.h> or something else.
>
> On Linux I couldn't tell you, check your documentation.
>
> [SNIP similar type errors]
>
> --
> Jim Langston
> (E-Mail Removed)


Ok, I'm using Visual C++ 6.0 with SP6 but not Visual Studio. I tried
adding those files and they're there but it doesn't have the
"addrinfo" procedure
 
Reply With Quote
 
Jim Langston
Guest
Posts: n/a
 
      04-01-2008
w0rd wrote:
> On Apr 1, 3:05 pm, "Jim Langston" <(E-Mail Removed)> wrote:
>> w0rd wrote:
>>> Hi guys,
>>> Wondering if you could help me with some errors I've been getting
>>> with the source of a commissioned project. I've got no C++
>>> experience so I've got no idea what's going on but when I try to
>>> compile in debug mode I get these errors (I've included the lines
>>> lines where the errors happen if it helps):

>>
>>> addrinfo *AI;
>>> \Async.cpp(47) : error C2065: 'addrinfo' : undeclared identifier

>>
>> These, and the following errors, seem to be occuring because you're
>> missing the include of the header file where they are defined. The
>> actual header file for sockets depends on your OS and compiler. In
>> windows it might be #include <WinSock2.h> or #include <WinSock.h> or
>> something else.
>>
>> On Linux I couldn't tell you, check your documentation.
>>
>> [SNIP similar type errors]
>>
>> --
>> Jim Langston
>> (E-Mail Removed)

>
> Ok, I'm using Visual C++ 6.0 with SP6 but not Visual Studio. I tried
> adding those files and they're there but it doesn't have the
> "addrinfo" procedure


From the MSDN that comes with my MSVC++ .net 2003 for getaddrinfo:

Requirements
Client: Included in Windows XP.
Server: Included in Windows Server 2003.
Header: Declared in Ws2tcpip.h.

So try
#include <Ws2tcpip.h>
I guess.


--
Jim Langston
(E-Mail Removed)


 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      04-01-2008
w0rd wrote:
>
> Ok, I'm using Visual C++ 6.0 with SP6 but not Visual Studio.


Why? It's old and well past its best.

--
Ian Collins.
 
Reply With Quote
 
lbonafide@yahoo.com
Guest
Posts: n/a
 
      04-01-2008
On Apr 1, 12:13*am, w0rd <(E-Mail Removed)> wrote:

> Ok, I'm using Visual C++ 6.0 with SP6 but not Visual Studio. *I tried
> adding those files and they're there but it doesn't have the
> "addrinfo" procedure- Hide quoted text -


Why aren't you asking in a Windows newsgroup that deals with VS
issues?

 
Reply With Quote
 
Erik Wikström
Guest
Posts: n/a
 
      04-01-2008
On 2008-04-01 07:07, Jim Langston wrote:
> Jim Langston wrote:
>> w0rd wrote:
>>> Hi guys,
>>> Wondering if you could help me with some errors I've been getting
>>> with the source of a commissioned project. I've got no C++
>>> experience so I've got no idea what's going on but when I try to
>>> compile in debug mode I get these errors (I've included the lines
>>> lines where the errors happen if it helps):
>>>
>>> addrinfo *AI;
>>> \Async.cpp(47) : error C2065: 'addrinfo' : undeclared identifier

>>
>> These, and the following errors, seem to be occuring because you're
>> missing the include of the header file where they are defined. The
>> actual header file for sockets depends on your OS and compiler. In
>> windows it might be #include <WinSock2.h> or #include <WinSock.h> or
>> something else.
>> On Linux I couldn't tell you, check your documentation.
>>
>> [SNIP similar type errors]

>
> My bad. Your post is titled VC++ 6.0 issues. Try
> #include <WinSock2.h>
> but you really should get away from 6.0 It was made prestandard and has
> other issues that'll frustrate you in the future to no end. You can
> download a free 2003 C++ from Microsoft although it has no optimizations of
> the executable. Or download Dev C++.


I assume you meant Visual C++ 2008 Express, in which case I can tell you
that it does perform (almost) all the optimisations that the more costly
versions do, what it lacks it the ability to use the profiler to guide
the optimisations.

--
Erik Wikström
 
Reply With Quote
 
w0rd
Guest
Posts: n/a
 
      04-02-2008
On Apr 1, 3:29 pm, Ian Collins <(E-Mail Removed)> wrote:
> w0rd wrote:
>
> > Ok, I'm using Visual C++ 6.0 with SP6 but not Visual Studio.

>
> Why? It's old and well past its best.
>
> --
> Ian Collins.


I know but it was programmed in VC 6.0 (by Konst from R-a-C and that's
just what he uses).
 
Reply With Quote
 
Kenneth Porter
Guest
Posts: n/a
 
 
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
Windows XP Pro clean install issues, SP2 issues too... Howie Computer Support 9 07-12-2005 04:47 PM
Windows XP Pro clean install issues, SP2 issues too... Howie Computer Support 0 07-06-2005 07:12 PM
Re: Windows XP Pro clean install issues, SP2 issues too... pcbutts1 Computer Support 0 07-06-2005 04:58 PM
Re: Windows XP Pro clean install issues, SP2 issues too... pcbutts1 Computer Support 0 07-06-2005 04:52 PM
SNMP Issues in Cisco Routers; Vulnerability Issues in TCP =?iso-8859-1?Q?Frisbee=AE?= MCSE 0 04-21-2004 03:00 PM



Advertisments