Why am I getting error C2061 identifier 'vector'

In one of my old projects I use vectors and simply needed to use include like this:

#include <vector>

Now i'm trying to insert my old code into someone else's project which likely is a different type of project (not sure which or how to find out).  While both projects are in C++ my old code that uses vectors now generates this error C2061: syntax error : identifier 'vector' in his project.

How do I get rid of this?  Thanks.

LVL 1
shaolinfunkAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

evilrixSenior Software Engineer (Avast)Commented:
did you need to add "using namespace std;" at the top of the .cpp file maybe?

or, prefix vector with std::
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
shaolinfunkAuthor Commented:
weird..putting using namespace std generates more errors...why is that?

but prefixing vector with std:: does the trick.
0
shaolinfunkAuthor Commented:
thanks for fast response evil!
0
evilrixSenior Software Engineer (Avast)Commented:
>> weird..putting using namespace std generates more errors...why is that?
It imports the std namespace into the current one. If you have other symbols with names that clash with those in the std namespace you'll get errors.

>> but prefixing vector with std:: does the trick.
What would have been my preferred solutions. I never import the std namespace, I always use fully qualified names for standard library items.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C++

From novice to tech pro — start learning today.