I converted my VC++ 6.0 Project to VC++.NET and during compilation, I get the
following error everywhere:
Error 1 error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int g:\argusweb\source\gssutil\xmlmessage.h 20
If is referring to the line:
log_comment(char *psz_comment, long bStart=0);
You can see it in the .h file below:
// XmlMessage.h: interface for the XmlMessage class.
//
//////////////////////////////////////////////////////////////////////
#if
!defined(AFX_XMLMESSAGE_H__9D3221FC_2D98_45A5_A442 _FC067DA2064D__INCLUDED_)
#define AFX_XMLMESSAGE_H__9D3221FC_2D98_45A5_A442_FC067DA2 064D__INCLUDED_
#define WINVER 0x0502
#if _MSC_VER 1000
#pragma once
#endif // _MSC_VER 1000
#include "msxml2.h"
#include "gss_types.h"
class XmlMessage
{
public:
static TCHAR* Escape(const TCHAR * pchXML);
log_comment(char *psz_comment, long bStart=0);
CString GetParseError();
static CString FormatDate(CString sDate, CString sDTFormat = _T("%Y/%m/%d
%H:%M:%S"));
XmlMessage(const TCHAR* pchXML, long lSpecial);
XmlMessage();
explicit XmlMessage(const long lGssMsg);
virtual ~XmlMessage();
operator long () {
return m_lGssMsg;
};
operator TCHAR* () {
TCHAR* pch = new TCHAR[m_sXml.GetLength() + 1];
_tcscpy(pch, m_sXml);
return pch;
}; 5 3665
Sounds like a valid error message. You need to change to:
int log_comment(char *psz_comment, long bStart=0);
or more likely:
void log_comment(char *psz_comment, long bStart=0);
Brian
"Nishal Patel" <Ni*********@discussions.microsoft.comwrote in message
news:6C**********************************@microsof t.com...
>I converted my VC++ 6.0 Project to VC++.NET and during compilation, I get the
following error everywhere:
Error 1 error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int g:\argusweb\source\gssutil\xmlmessage.h 20
If is referring to the line:
log_comment(char *psz_comment, long bStart=0);
You can see it in the .h file below:
// XmlMessage.h: interface for the XmlMessage class.
//
//////////////////////////////////////////////////////////////////////
#if
!defined(AFX_XMLMESSAGE_H__9D3221FC_2D98_45A5_A442 _FC067DA2064D__INCLUDED_)
#define AFX_XMLMESSAGE_H__9D3221FC_2D98_45A5_A442_FC067DA2 064D__INCLUDED_
#define WINVER 0x0502
#if _MSC_VER 1000
#pragma once
#endif // _MSC_VER 1000
#include "msxml2.h"
#include "gss_types.h"
class XmlMessage
{
public:
static TCHAR* Escape(const TCHAR * pchXML);
log_comment(char *psz_comment, long bStart=0);
CString GetParseError();
static CString FormatDate(CString sDate, CString sDTFormat = _T("%Y/%m/%d
%H:%M:%S"));
XmlMessage(const TCHAR* pchXML, long lSpecial);
XmlMessage();
explicit XmlMessage(const long lGssMsg);
virtual ~XmlMessage();
operator long () {
return m_lGssMsg;
};
operator TCHAR* () {
TCHAR* pch = new TCHAR[m_sXml.GetLength() + 1];
_tcscpy(pch, m_sXml);
return pch;
};
Thanks. That worked. Needed to set to VOID in front.
Got another questions with compile problem. It does not like this:
friend istream& operator>>(istream& ar, AString& string);
Gives the following error:
Error 2 error C2433: 'ostream' : 'friend' not permitted on data
declarations g:\argusweb\source\dbapp\AString.h 115
"Brian Muth" wrote:
Sounds like a valid error message. You need to change to:
int log_comment(char *psz_comment, long bStart=0);
or more likely:
void log_comment(char *psz_comment, long bStart=0);
Brian
"Nishal Patel" <Ni*********@discussions.microsoft.comwrote in message
news:6C**********************************@microsof t.com...
I converted my VC++ 6.0 Project to VC++.NET and during compilation, I get
the
following error everywhere:
Error 1 error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int g:\argusweb\source\gssutil\xmlmessage.h 20
If is referring to the line:
log_comment(char *psz_comment, long bStart=0);
You can see it in the .h file below:
// XmlMessage.h: interface for the XmlMessage class.
//
//////////////////////////////////////////////////////////////////////
#if
!defined(AFX_XMLMESSAGE_H__9D3221FC_2D98_45A5_A442 _FC067DA2064D__INCLUDED_)
#define AFX_XMLMESSAGE_H__9D3221FC_2D98_45A5_A442_FC067DA2 064D__INCLUDED_
#define WINVER 0x0502
#if _MSC_VER 1000
#pragma once
#endif // _MSC_VER 1000
#include "msxml2.h"
#include "gss_types.h"
class XmlMessage
{
public:
static TCHAR* Escape(const TCHAR * pchXML);
log_comment(char *psz_comment, long bStart=0);
CString GetParseError();
static CString FormatDate(CString sDate, CString sDTFormat = _T("%Y/%m/%d
%H:%M:%S"));
XmlMessage(const TCHAR* pchXML, long lSpecial);
XmlMessage();
explicit XmlMessage(const long lGssMsg);
virtual ~XmlMessage();
operator long () {
return m_lGssMsg;
};
operator TCHAR* () {
TCHAR* pch = new TCHAR[m_sXml.GetLength() + 1];
_tcscpy(pch, m_sXml);
return pch;
};
Nishal Patel wrote:
Thanks. That worked. Needed to set to VOID in front.
Got another questions with compile problem. It does not like this:
friend istream& operator>>(istream& ar, AString& string);
Gives the following error:
Error 2 error C2433: 'ostream' : 'friend' not permitted on data
declarations g:\argusweb\source\dbapp\AString.h 115
The error points to ostream, which I don't see in your code. Where's
AString? You have to show us a short but 100% complete sample that
reproduces the problem, or at least include enough contextual information.
This compiles to me, so it's really not that line of code that causes
the error:
using namespace std;
class AString
{
friend istream& operator>>(istream& ar, AString& string);
};
istream& operator>>(istream& ar, AString& string)
{
return ar;
}
Tom
Yes, that compiles; however, adding
void main()
{
AString a;
cin >a;
}
gives "error C2593: 'operator >>' is ambiguous."
Though I don't completely understand the cause, one solution appears to be to add prototypes at the beginning, i.e.
class AString;
istream& operator>>(istream& ar, AString& string);
class AString
{
friend istream& operator>>(istream& ar, AString& string);
};
istream& operator>>(istream& ar, AString& string)
{
return ar;
}
void main()
{
AString a;
operator>>(cin, a);
}
However, I don't know if this, in turn, will lead to other problems. If anyone knows of a better, or preferred, solution let me know. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Paljo |
last post by:
Trying to compile VC++ 6 project in VC++ 7 and getting a
compiling error,
error C2955: '_com_ptr_t' : use of class template requires
template argument list
Any thoughts?
Thanks
|
by: Ben Terry |
last post by:
Hello,
I have a VS 2003.NET solution which consists of four c++ unmanaged legacy
projects. I am adding a new project to the solution which will be in c#.
What do I need to do to my c++ projects...
|
by: Ganapathy |
last post by:
I have COM dll code written in VC 6.0. When i tried
compiling this code in VC 7, The MIDL cmpiler gets called
twice. i.e. it initially compiles fully & immediately a
line - 64 bit processing'...
|
by: _R |
last post by:
Given that VS2005 has made an effort to clean up the syntax of VC++
(in C++/CLI), is there any future plans to do away with function
protos, ala C#/VB? What are they needed for these days?
|
by: Richard MSL |
last post by:
I have a command line project that I am migrating from VS2003 to VS2005.
There is a combination of C, C++ and C#. When I build the project, I have
this in my call to cl.exe in my batch file:
...
| |
by: Bonggoy Cruz |
last post by:
We have a fairly big size ASP.NET web application that was written VB.NET.
We are in the process converting the web project.
We used the migration wizard included in VS 2005. I followed step by...
|
by: lewisksh |
last post by:
hi, i have 1 MFC project which is written using VC++2003 but i need to
migrate to VC++2005. The program (VC++2003) is working fine. but there
is erros occur when running in VC++2005, and i just...
|
by: parekh |
last post by:
Hi All ,
I am facing a problem wherein my VB project is not recognizing a change in the argument list of a method ( the method itself being declared and defined in another VC++ project and it...
|
by: nmrcarl |
last post by:
I'm trying to upgrade a large project from VS 6.0 to VS 2005.
After fixing a lot of things that changed (mostly sloppy coding in the
original project that VS2005 didn't allow), I got the release...
|
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,...
|
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...
| |
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: 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...
|
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...
|
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: 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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |