Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help! Compiler VC++ 7.0 error

Status
Not open for further replies.

basquang

Newbie level 4
Joined
Nov 20, 2004
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
75
q241949

I've just installed VS.NET 2003 Enterprise Architect on winXPsp1 pro. However I couldn't get any project with win32 app or console app to compile even if I create a new empty project (default). It gave me a bunch of "missing ;"
errors. I did reinstall the whole thing a few times but it didn't work.


Anyone have any idea?


Thanks


c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(862) :
error C2143: syntax error : missing ';' before '<'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(935) :
see reference to class template instantiation
'std::istreambuf_iterator<_Elem,_Traits>' being compiled
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(862) :
error C2238: unexpected token(s) preceding ';'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(863) :
error C2143: syntax error : missing ';' before '<'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(863) :
error C2238: unexpected token(s) preceding ';'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(866) :
error C2143: syntax error : missing ')' before '*'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(866) :
error C2143: syntax error : missing ';' before '*'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(866) :
error C2864: '_Sb' : only const static integral data members can be
initialized inside a class or struct
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(866) :
error C2501: 'std::istreambuf_iterator<_Elem,_Traits>::_Sb' : missing
storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(866) :
error C2143: syntax error : missing ';' before 'throw'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(866) :
error C2334: unexpected token(s) preceding ':'; skipping apparent function
body
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(871) :
error C2143: syntax error : missing ')' before '&'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(871) :
error C2143: syntax error : missing ';' before '&'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(871) :
error C2059: syntax error : ')'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(871) :
error C2143: syntax error : missing ';' before 'throw'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(871) :
error C2501: 'std::istreambuf_iterator<_Elem,_Traits>::_Istr' : missing
storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(871) :
error C2334: unexpected token(s) preceding ':'; skipping apparent function
body
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(932) :
error C2143: syntax error : missing ';' before '*'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xutility(932) :
error C2501:


.......


c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\streambuf(320) :
error C2146: syntax error : missing ';' before identifier 'xsputn'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\streambuf(320) :
error C2433: 'std::basic_streambuf<_Elem,_Traits>::streamsize' : 'virtual'
not permitted on data declarations
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\streambuf(320) :
error C2501: 'std::basic_streambuf<_Elem,_Traits>::streamsize' : missing
storage-class or type specifiers
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\streambuf(320) :
fatal error C1003: error count exceeds 100; stopping compilation
 

visual c++ c2238 c2059 template

You need a source file for your project and the source file must have the following

#include "stdafx.h"

as the very first line.
 

visual studio 2003 c++ error c2501

I can't believe that a modern C or C++ compiler (even one from Bill Gates) would require a non-portable #include in the source. Surely there must be a compiler switch to make it behave normally.
 

error c2059 structure initialization

Yes, in VC6 you can use the option (Not using Precompiled header files) for each C file

Antharax
 

std::istreambuf_iterator vc6

echo47 said:
I can't believe that a modern C or C++ compiler (even one from Bill Gates) would require a non-portable #include in the source. Surely there must be a compiler switch to make it behave normally.



Do we have an "MFC" for LINUX?
 

visual studio /dsymbol

There is winelib but it's still a work in progress (ie incomplete and buggy).
 

mfc xutility error

as per MSDN the error refer to some details which i am giving below and lets see if it helps u...


Visual C++ Concepts: Building a C/C++ Program
Compiler Error C2059

Language Filter: All Language Filter: Multiple Language Filter: Visual Basic Language Filter: C# Language Filter: C++ Language Filter: J# Language Filter: JScript
Visual Basic (Declaration)
Visual Basic (Usage)
C#
C++
J#
JScript
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Error Message
syntax


The token caused a syntax error.

To determine the cause, examine not only the line listed in the error message, but also the lines above it. The following example generates an error message for the line containing the open curly brace, but the true source of the error appears on the line just above it.

Copy Code
// C2059a.cpp
// compile with: /c
int main ) {} // C2059 No opening parenthesis


If examining the lines yields no clue to what the problem might be, try commenting out the line listed in the error message and possibly several lines above it.

If the error message occurs on a symbol immediately following a typedef variable, check that the variable is defined in the source code.

You may get C2059 if a symbol evaluates to nothing, as can occur when you compile with /Dsymbol=.

Copy Code
// C2059b.cpp
// compile with: /DTEST=
#include <stdio.h>

int main()
{
#ifdef TEST
printf_s("\nTEST defined %d", TEST); // C2059
#else
printf_s("\nTEST not defined");
#endif
}


Another specific reason you can get C2059 is when you compile an application that specifies a structure in the default arguments for a function. The default value for an argument must be an expression. An initializer list, such as that used to initialize a structure, is not an expression. The resolution is to define a constructor to perform the required initialization.

The following example generates C2059:

Copy Code
// C2059c.cpp
// compile with: /c
struct ag_type
{
int a;
float b;
// Uncomment the following line to resolve.
// ag_type(int aa, float bb) : a(aa), b(bb) {}
};

void func(ag_type arg = {5, 7.0}); // C2059
void func(ag_type arg = ag_type(5, 7.0)); // OK


You can also get C2059 if you define a member template class or function outside the class. See Knowledge Base article Q241949 for more information.

C2059 can occur for an ill-formed cast.

The following sample generates C2059:

Copy Code
// C2059d.cpp
// compile with: /clr
using namespace System;
ref class From {};
ref class To : public From {};

int main()
{
From^ refbase = gcnew To();
To^ refTo = safe_cast<To^>(From^); // C2059
To^ refTo2 = safe_cast<To^>(refbase); // OK
}


C2059 can also occur if you attempt to create a namespace name that contains a period.

The following sample generates C2059:

Copy Code
// C2059e.cpp
// compile with: /c
namespace A.B {} // C2059

// OK
namespace A
{
namespace B
{
}
}


C2059 can also occur if you define a member template class or function outside the class. See Knowledge Base article Q241949 for more information. You can find Knowledge Base articles on the MSDN Library CD-ROM or at https://support.microsoft.com.

Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.
 

visual c2059 struct initialization

Can you help me the problem?
 

syntax error c++ c2059 parentheses

why dont you copy a sample program to execute

or paste your code to this Thread and let some one see for any obvious erros in the code it self


Regards
dEVEN
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top