-
Warnings with vector STL
In a console app:
I'm getting some wierd warning's and I don't know why.
These are some of them:
c:\program files\microsoft visual studio\vc98\include\vector(39) : warning
C4786: 'std::reverse_iterator<std::basic_...and so on.
I'm getting four of them all of them are in the same directory. Is there
some law about not being able to use them in a class as private or what?
Is there settings that my project needs?
Any help would be appreciated.
Here is a little bit of code that gives me these warnings.
#include<iostream>
#include<vector>
using namespace std;
class MyClass
{
public:
private:
vector<string> myList;
};
int main()
{
MyClass aClass;
return 0;
}
-
Re: Warnings with vector STL
What is the exact text message you're getting? Is it something like
"identifier's length exceeds 255 characters"? If so, you can ignore this
warning safely.
Danny
Chad Gorshing wrote:
>
> In a console app:
> I'm getting some wierd warning's and I don't know why.
> These are some of them:
>
> c:\program files\microsoft visual studio\vc98\include\vector(39) : warning
> C4786: 'std::reverse_iterator<std::basic_...and so on.
>
> I'm getting four of them all of them are in the same directory. Is there
> some law about not being able to use them in a class as private or what?
> Is there settings that my project needs?
>
> Any help would be appreciated.
> Here is a little bit of code that gives me these warnings.
>
> #include<iostream>
> #include<vector>
> using namespace std;
>
> class MyClass
> {
> public:
>
> private:
> vector<string> myList;
> };
>
> int main()
> {
> MyClass aClass;
> return 0;
> }
-
Re: Warnings with vector STL
Danny is correct, ignoring this warning is usually safe. Use a #pragma warning
(disable: 4786,4788) to suppress the messages.
"Chad Gorshing" <gorshing_c@alph.swosu.edu> wrote:
>
>In a console app:
>I'm getting some wierd warning's and I don't know why.
>These are some of them:
>
>c:\program files\microsoft visual studio\vc98\include\vector(39) : warning
>C4786: 'std::reverse_iterator<std::basic_...and so on.
>
>I'm getting four of them all of them are in the same directory. Is there
>some law about not being able to use them in a class as private or what?
> Is there settings that my project needs?
>
>Any help would be appreciated.
>Here is a little bit of code that gives me these warnings.
>
>#include<iostream>
>#include<vector>
>using namespace std;
>
>class MyClass
>{
>public:
>
>private:
> vector<string> myList;
>};
>
>int main()
>{
> MyClass aClass;
> return 0;
>}
-
Re: Warnings with vector STL
"Chad Gorshing" <gorshing_c@alph.swosu.edu> wrote:
>
>In a console app:
>I'm getting some wierd warning's and I don't know why.
>These are some of them:
>
>c:\program files\microsoft visual studio\vc98\include\vector(39) : warning
>C4786: 'std::reverse_iterator<std::basic_...and so on.
>
>I'm getting four of them all of them are in the same directory. Is there
>some law about not being able to use them in a class as private or what?
> Is there settings that my project needs?
>
>Any help would be appreciated.
>Here is a little bit of code that gives me these warnings.
>
>#include<iostream>
>#include<vector>
>using namespace std;
>
>class MyClass
>{
>public:
>
>private:
> vector<string> myList;
>};
>
>int main()
>{
> MyClass aClass;
> return 0;
>}
Hint:
Where does string comes from?
see ya
-
Re: Warnings with vector STL
For "string" you will have to include <string>
So your code will look like this
#include<iostream>
#include<vector>
#include <string> <---------------- Add This
using namespace std;
class MyClass
{
public:
private:
vector<string> myList;
};
int main()
{
MyClass aClass;
return 0;
}
"phong" <phong21@hotmail.com> wrote:
>
>"Chad Gorshing" <gorshing_c@alph.swosu.edu> wrote:
>>
>>In a console app:
>>I'm getting some wierd warning's and I don't know why.
>>These are some of them:
>>
>>c:\program files\microsoft visual studio\vc98\include\vector(39) : warning
>>C4786: 'std::reverse_iterator<std::basic_...and so on.
>>
>>I'm getting four of them all of them are in the same directory. Is there
>>some law about not being able to use them in a class as private or what?
>> Is there settings that my project needs?
>>
>>Any help would be appreciated.
>>Here is a little bit of code that gives me these warnings.
>>
>>#include<iostream>
>>#include<vector>
>>using namespace std;
>>
>>class MyClass
>>{
>>public:
>>
>>private:
>> vector<string> myList;
>>};
>>
>>int main()
>>{
>> MyClass aClass;
>> return 0;
>>}
>
>
>Hint:
> Where does string comes from?
>
>see ya
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks