|
I have writen a program :
#include <string>
using namespace std;
int main()
{
string a("a");
return 0;
}
when i compile it
then it is the result :
--------------------Configuration: abc - Win32 Debug--------------------
Compiling...
abc.cpp
c:\program files\microsoft visual studio\vc98\include\xstring(600) : error C2838: illegal qualified name in member declaration
c:\program files\microsoft visual studio\vc98\include\xstring(618) : see reference to class template instantiation 'std::basic_string<_E,_Tr,_A>' being compiled
c:\program files\microsoft visual studio\vc98\include\stdexcept(19) : error C2629: unexpected 'class std::logic_error ('
c:\program files\microsoft visual studio\vc98\include\stdexcept(19) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
c:\program files\microsoft visual studio\vc98\include\stdexcept(29) : error C2146: syntax error : missing ';' before identifier '_Str'
c:\program files\microsoft visual studio\vc98\include\stdexcept(29) : error C2501: 'string' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\stdexcept(29) : error C2501: '_Str' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\stdexcept(34) : error C2629: unexpected 'class std::domain_error ('
c:\program files\microsoft visual studio\vc98\include\stdexcept(34) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
c:\program files\microsoft visual studio\vc98\include\stdexcept(45) : error C2629: unexpected 'class std::invalid_argument ('
c:\program files\microsoft visual studio\vc98\include\stdexcept(45) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
c:\program files\microsoft visual studio\vc98\include\stdexcept(56) : error C2629: unexpected 'class std::length_error ('
c:\program files\microsoft visual studio\vc98\include\stdexcept(56) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
c:\program files\microsoft visual studio\vc98\include\stdexcept(67) : error C2629: unexpected 'class std::out_of_range ('
c:\program files\microsoft visual studio\vc98\include\stdexcept(67) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
c:\program files\microsoft visual studio\vc98\include\stdexcept(78) : error C2629: unexpected 'class std::runtime_error ('
c:\program files\microsoft visual studio\vc98\include\stdexcept(78) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
c:\program files\microsoft visual studio\vc98\include\stdexcept(88) : error C2146: syntax error : missing ';' before identifier '_Str'
c:\program files\microsoft visual studio\vc98\include\stdexcept(88) : error C2501: 'string' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\stdexcept(88) : error C2501: '_Str' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\stdexcept(93) : error C2629: unexpected 'class std::overflow_error ('
c:\program files\microsoft visual studio\vc98\include\stdexcept(93) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
c:\program files\microsoft visual studio\vc98\include\stdexcept(104) : error C2629: unexpected 'class std::underflow_error ('
c:\program files\microsoft visual studio\vc98\include\stdexcept(104) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
c:\program files\microsoft visual studio\vc98\include\stdexcept(115) : error C2629: unexpected 'class std::range_error ('
c:\program files\microsoft visual studio\vc98\include\stdexcept(115) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
c:\program files\microsoft visual studio\vc98\include\xlocinfo(39) : error C2039: '_Collvec' : is not a member of '`global namespace''
c:\program files\microsoft visual studio\vc98\include\xlocinfo(39) : error C2146: syntax error : missing ';' before identifier '_Collvec'
c:\program files\microsoft visual studio\vc98\include\xlocinfo(39) : error C2868: '_Collvec' : illegal syntax for using-declaration; expected qualified-name
c:\program files\microsoft visual studio\vc98\include\xlocinfo(40) : error C2039: '_Ctypevec' : is not a member of '`global namespace''
c:\program files\microsoft visual studio\vc98\include\xlocinfo(40) : error C2146: syntax error : missing ';' before identifier '_Ctypevec'
c:\program files\microsoft visual studio\vc98\include\xlocinfo(40) : error C2868: '_Ctypevec' : illegal syntax for using-declaration; expected qualified-name
c:\program files\microsoft visual studio\vc98\include\xlocinfo(41) : error C2039: '_Cvtvec' : is not a member of '`global namespace''
c:\program files\microsoft visual studio\vc98\include\xlocinfo(41) : error C2146: syntax error : missing ';' before identifier '_Cvtvec'
c:\program files\microsoft visual studio\vc98\include\xlocinfo(41) : error C2868: '_Cvtvec' : illegal syntax for using-declaration; expected qualified-name
c:\program files\microsoft visual studio\vc98\include\xlocinfo(47) : error C2146: syntax error : missing ';' before identifier '_Getname'
c:\program files\microsoft visual studio\vc98\include\xlocinfo(47) : error C2501: 'string' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xlocinfo(48) : warning C4183: '_Getname': member function definition looks like a ctor, but name does not match enclosing class
c:\program files\microsoft visual studio\vc98\include\xlocinfo(85) : error C2146: syntax error : missing ';' before identifier '_Days'
c:\program files\microsoft visual studio\vc98\include\xlocinfo(85) : error C2501: 'string' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xlocinfo(85) : error C2501: '_Days' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xlocinfo(85) : error C2501: '_Months' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xlocinfo(85) : error C2501: '_Oname' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xlocinfo(85) : error C2501: '_Nname' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xlocale(86) : error C2146: syntax error : missing ';' before identifier '_Name'
c:\program files\microsoft visual studio\vc98\include\xlocale(86) : error C2501: 'string' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xlocale(86) : error C2501: '_Name' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xlocale(90) : error C2143: syntax error : missing ',' before '&'
c:\program files\microsoft visual studio\vc98\include\xlocale(90) : error C2059: syntax error : '&'
c:\program files\microsoft visual studio\vc98\include\xlocale(112) : error C2146: syntax error : missing ';' before identifier 'name'
c:\program files\microsoft visual studio\vc98\include\xlocale(112) : error C2501: 'string' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xlocale(113) : warning C4183: 'name': member function definition looks like a ctor, but name does not match enclosing class
c:\program files\microsoft visual studio\vc98\include\xiosbase(19) : error C2504: 'runtime_error' : base class undefined
c:\program files\microsoft visual studio\vc98\include\xiosbase(21) : error C2629: unexpected 'class std::ios_base::failure ('
c:\program files\microsoft visual studio\vc98\include\xiosbase(21) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
c:\program files\microsoft visual studio\vc98\include\xiosbase(118) : error C2146: syntax error : missing ';' before identifier 'getloc'
c:\program files\microsoft visual studio\vc98\include\xiosbase(118) : error C2501: 'locale' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xiosbase(119) : warning C4183: 'getloc': member function definition looks like a ctor, but name does not match enclosing class
c:\program files\microsoft visual studio\vc98\include\xiosbase(120) : error C2146: syntax error : missing ';' before identifier 'imbue'
c:\program files\microsoft visual studio\vc98\include\xiosbase(120) : error C2501: 'locale' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xiosbase(120) : error C2143: syntax error : missing ',' before '&'
c:\program files\microsoft visual studio\vc98\include\xiosbase(120) : error C2059: syntax error : '&'
c:\program files\microsoft visual studio\vc98\include\xiosbase(168) : error C2146: syntax error : missing ';' before identifier '_Loc'
c:\program files\microsoft visual studio\vc98\include\xiosbase(168) : error C2501: 'locale' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xiosbase(168) : error C2501: '_Loc' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xlocnum(21) : error C2653: 'locale' : is not a class or namespace name
c:\program files\microsoft visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation 'std::numpunct<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocnum(21) : error C2504: 'facet' : base class undefined
c:\program files\microsoft visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation 'std::numpunct<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocnum(26) : error C2653: 'locale' : is not a class or namespace name
c:\program files\microsoft visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation 'std::numpunct<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocnum(26) : error C2146: syntax error : missing ';' before identifier 'id'
c:\program files\microsoft visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation 'std::numpunct<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocnum(26) : error C2501: 'id' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation 'std::numpunct<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocnum(31) : error C2146: syntax error : missing ';' before identifier 'grouping'
c:\program files\microsoft visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation 'std::numpunct<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocnum(31) : error C2501: 'string' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation 'std::numpunct<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocnum(32) : warning C4183: 'grouping': member function definition looks like a ctor, but name does not match enclosing class
c:\program files\microsoft visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation 'std::numpunct<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocnum(39) : error C2629: unexpected 'class std::numpunct<_E> ('
c:\program files\microsoft visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation 'std::numpunct<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocnum(39) : error C2334: unexpected token(s) preceding ':'; skipping apparent function body
c:\program files\microsoft visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation 'std::numpunct<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocnum(49) : error C2143: syntax error : missing ',' before '&'
c:\program files\microsoft visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation 'std::numpunct<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocnum(49) : error C2059: syntax error : '&'
c:\program files\microsoft visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation 'std::numpunct<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocnum(60) : error C2146: syntax error : missing ';' before identifier 'do_grouping'
c:\program files\microsoft visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation 'std::numpunct<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocnum(60) : error C2433: 'string' : 'virtual' not permitted on data declarations
c:\program files\microsoft visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation 'std::numpunct<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocnum(60) : error C2501: 'string' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation 'std::numpunct<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocnum(61) : warning C4183: 'do_grouping': member function definition looks like a ctor, but name does not match enclosing class
c:\program files\microsoft visual studio\vc98\include\xlocnum(69) : see reference to class template instantiation 'std::numpunct<_E>' being compiled
c:\program files\microsoft visual studio\vc98\include\xlocnum(83) : error C2653: 'locale' : is not a class or namespace name
c:\program files\microsoft visual studio\vc98\include\xlocnum(83) : error C2143: syntax error : missing ';' before 'tag::id'
c:\program files\microsoft visual studio\vc98\include\xlocnum(83) : error C2501: 'id' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\xlocnum(83) : error C2059: syntax error : ';'
c:\program files\microsoft visual studio\vc98\include\xlocnum(83) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Error executing cl.exe.
abc.exe - 80 error(s), 5 warning(s)
please help me
i will very appreciate
help!!!
|
|
|
|
|
why dont u use the class CString?
|
|
|
|
|
Because it's an STL exercise. Just because someone gets an error with STL does not automatically warrant a "Use MFC" comment.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
And what does he use if he can't get that to work?
Steve
|
|
|
|
|
edit your post so that we can see your include
btw, include this:
#include <STRING>
|
|
|
|
|
I agree, it seems as if you forgt an "#include" statement or some needed setting is not set properly.
|
|
|
|
|
A small knit pick, but you should use lowercase.
Steve
|
|
|
|
|
why ?
i always include the standard C++ headers in uppercase, as the include file names are written like that...
please explain your feeling
|
|
|
|
|
It is standard practice when writing portable code. On some systems, such as Linux, the file system is case sensitive. The standard headers are required to be lowercase.
Steve
|
|
|
|
|
The code you've shown is fine. Something else is at play, like using the /Za compiler switch.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
It should work. Are you using pre-compiled headers? If so did you put the
stdafx.h before the string include?
|
|
|
|
|
Hi everyone,
in my project, i have a DataGrid. If i size the ChildWindow, i refresh the number of rows of the grid
relative to the height.
At the refresh-function i need to change and load some things ( for example a new record from the DB )
So it takes a certain duration.
If i resize the Frame slowly, it works nice.
But if i resize it very fast, so there a many callings to resize the form.
For that reason i will lock the "Refresh-function" and only refresh at the end of the resizing.
But how can i "see" that the user has stopped the resizing of the frame?
Any ideas?
Big thanks
|
|
|
|
|
Hmm when the resizing stops, the user as released the mouse... maybe you can catch this event and look everytime its called if there had been a resizement.
Maybe by a "locking" variable in your "refresh Function"
-> Mosedown -> lock enable refresh part not called
-> Moseup -> lock release -> refresh/paint
|
|
|
|
|
Yeah, i had the same idea, but the Resizing-Border of the View nor of the Frame will call a MouseUp-Event
Trotzdem Danke
|
|
|
|
|
Trapping the mouse will have no effect when sizing, you should try using the WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE . BTW. these two messages are only sent to the main window and not child controls. Another message you could try trapping is the WM_WINDOWPOSCHANGED .
|
|
|
|
|
Great!
Thanks !
|
|
|
|
|
Hi, i have a problem... how i implement the canc button in list box?
The message WM_KEYDOWN and WM_CHAR don't work.
thanks....
Giulio
|
|
|
|
|
What do you intend to do?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
I want cancel an element on list box....
|
|
|
|
|
only with the canc button on the keyboard
|
|
|
|
|
Ing.Raiz82 wrote: the canc button on the keyboard
My (UK) keyboard doesn't have a "canc" button
Do you mean delete?
|
|
|
|
|
yes i mean delete button on the keyboard...
sorry for my english...
|
|
|
|
|
|
Thanks.... a lot....
Giulio
|
|
|
|
|
Di nulla.
Carlo
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|