Re: HELP: Visual Studio.NET 2003 building woes .... :S

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



KevinGPO wrote:

Thanks. I manage to fix some of these errors. There's still some errors that

buffle me.

1. DLL creation:

HGBaseu.def(76): fatal error LNK1118: syntax error in '70' statement

(points to)

?CreateThreadProcessor@CGeneralTimerThreadQueue@@MAEPAVCGeneralTimerThread@@V

CHGVoidCall@@J@Z 70 NONAME



2. Originally it said ostream cannot be inline so I commented that out.

However I don't understand the errors:

GUID.h(54): error C2143: syntax error : missing ';' before '&'
GUID.h(54): error C2501: 'ostream' : missing storage-class or type specifiers
GUID.h(54): error C2065: 'strm' : undeclared identifier
GUID.h(54): error C2065: 'ID' : undeclared identifier
GUID.h(54): error C2275: 'CGUID' : illegal use of this type as an expression
GUID.h(54): error C2501: 'operator`<<'' : missing storage-class or type

specifiers
GUID.h(54): error C2365: 'operator`<<'' : redefinition; previous definition

was a 'member function'
GUID.h(54): error C2078: too many initializers
GUID.h(55): error C2143: syntax error : missing ';' before '{'
GUID.h(55): error C2447: '{' : missing function header (old-style formal

list?)

(all points to)

/*inline*/ ostream& operator<<(ostream& strm,CGUID& ID)
{
return strm<< (CString)ID;
}



3. Some problems with namespaces:

SortedArray2.h(75): error C2039: '[]' : is not a member of 'operator``global

namespace'''

(points to)

inline TYPE& CSortedArray2<TYPE>::operator[](int nIndex)
{
return m_InternalArray[nIndex];
}




I get a lot of repeated errors of the above 3 plus lots of template errors. I

believe Visual C++ 6.0 didn't comply with the C++ standards on how to define

templates right?


"David Wilkinson" <no-reply@xxxxxxxxxxxx> wrote in message news:uQRnXhSQGHA.2992@xxxxxxxxxxxxxxxxxxxxxxx

KevinGPO wrote:


My application was developed under Visual C++ 6.0, ATL, MFC & PlatformSDK Feb2003 (the last VC6 compatible version).

I am wondering if PlatformSDK Feb2003 is compatible with Visual Studio.NET 2003? I am having major problems trying to port/build my application under Visual Studio.NET 2003 using the unmanaged/native C++ compiler.

I was told that Visual Studio.NET 2003 had native C++ compiler support. I am aware about the new C++ 1999 changes (eg. #include <iostream>, using namespace std; etc). However my errors seem to be related to the PlatformSDK Feb2003. eg:

error C2039: 'Delete' : is not a member of 'CCommandEx<TAccessor>' with [TAccessor=ATL::CManualAccessor]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error C2065: 'AFX_OLE_DATETIME_ERROR' : undeclared identifier

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error C2143: syntax error : missing ',' before '<'

NOTE: what is this issue about templates??? my templates are like:

<code snip>
template <class TAccessor = CNoAccessor, template <typename T> class TRowset = CRowset>
class CAccessorRowset :
public TAccessor,
public TRowset<TAccessor> // error C2143
{
<code snip>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error C2440: 'type cast' : cannot convert from 'CFile' to 'HFILE'

<code snip>
if ((HFILE)File==CFile::hFileNull)
<code snip>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error C2475: 'CDouble::GetDoubleValue' : forming a pointer-to-member requires explicit use of the address-of operator ('&') and a qualified name

<code snip>
if(Value.GetDoubleValue != 0)
<code snip>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error C2516: 'TRowset' : is not a legal base class

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


and there's more. What was wrong with Visual C++ 6.0? and why is there so many errors when trying to compile under Visual Studio.NET 2003? Does anyone know a quick conversion script?

Kevin:

Please don't cross-post.

Why do you think this has to do with the PSDK? Most of these errors seem to be C++ compiler issues. Have you tried to fix them? For example, looking at the CFile source I see in VC6

UINT m_hFile;
operator HFILE() const;

and in VC7.1

HANDLE m_hFile;
operator HANDLE() const;

David Wilkinson


Kevin:

Clearly there is something wrong with the way you have declared the function

ostream& operator <<(ostream& strm, CGUID& ID)

If the declaration is inside the CGUID class, it should be a friend. But if the CString conversion is public, the declaration does not need to be inside the class.

David Wilkinson

.



Relevant Pages

  • Re: friend class in template
    ... This template takes 3 type parameters, the first of which is named ... The friend declaration attempts to declare the class ... the friend declaration doesn't do what the author apparently ... thought it would do (at least not on a conforming compiler). ...
    (microsoft.public.vc.language)
  • Re: #include question
    ... >>The definition of a class or template tells the compiler what to do when ... After the compiler has created all the objects of a ... > By default a variable is defined (which includes declaration) unless it ... > A function is usually declared in a header file. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: Problem with declaring a template friend.
    ... It works now on the MS compiler. ... declaration and the paramiter types you give in the friend declaration. ... template function, without them, it will make your class a friend of ... This declaration *doesn't* refer to a specialization of the template ...
    (comp.lang.cpp)
  • template error in friend declaration
    ... I tried to compile a cpp program which ran correctly on previous ... for other declaration, the + operator, it works!! ... It works on previous compiler ... template ...
    (Debian-User)
  • Re: OOP and OOD for senior C-style embedded software engineers
    ... metaprogramming in C++ to whole different level using the template ... templates let the compiler do more work ... The worst thing is when a function throws an exception ... And of course, exception specifications should work like people think they work, not as they /do/ work. ...
    (comp.arch.embedded)