1,105,232 Community Members

Does not name a type

Member Avatar
Newbie Poster
1 post since Apr 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]

I've been searching this for a little while now and I'm absolutely unable to figure out what the problem is.

This is the code I'm having the issue with:

std::vector<std::string> TexName;

and I get...

error: 'TexName' does not name a type

I've included both vector and string library, theres no name conflicts, and I've tried using namespace std; but it didn't work. While searching I seen other people using similar code; with the vector of strings, and it seemed to work with them.

Any help plz?


I figured it out. I didn't have it in a function. Oops. Thanks for your time.

Member Avatar
Bad Cop
12,139 posts since Sep 2004
Reputation Points: 5,693 [?]
Q&As Helped to Solve: 1,537 [?]
Skill Endorsements: 80 [?]
Team Colleague

Please post a complete program that exhibits the problem.

Member Avatar
Junior Poster
165 posts since Feb 2011
Reputation Points: 37 [?]
Q&As Helped to Solve: 26 [?]
Skill Endorsements: 0 [?]

Seems, fine, ensure you have the correct headers.

#include <vector>
#include <string>

int main()
    std::vector<std::string> TexName;
    return 0;
This article has been dead for over three months: Start a new discussion instead
Start New Discussion
View similar articles that have also been tagged: