Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

STL Usage #147

Closed
freemancw opened this Issue Dec 30, 2012 · 4 comments

Comments

Projects
None yet
2 participants
Contributor

freemancw commented Dec 30, 2012

I get funky errors when I try to use STL classes (ex: I include vector but get an error about vector not being a member of std), and I'm not sure exactly what to do. I suppose it has something to do with using STLPort, but I'm pretty lost TBH. Older guides on qeradiant.com didn't help much.

Using VS2012/Win7

Owner

TTimo commented Dec 30, 2012

Do you have some example code maybe, like a patch?

Contributor

freemancw commented Jan 4, 2013

I can reproduce the error by just #include at the top of any file in the Radiant project, then somewhere in the file adding std::vector testVec;

Here are the errors when I did the above in gtkmisc.cpp

1>gtkmisc.cpp(70): error C2039: 'vector' : is not a member of 'std'
1>gtkmisc.cpp(70): error C2143: syntax error : missing ';' before '<'

Owner

TTimo commented Jan 4, 2013

I believe STL includes need to go through a specific include that is
already in radiant. All vector/map etc. classes should be already in there.
The reason is the wrapping that needs to happen so we use a
standards-compatible STL against MSVC rather than MSVC's builtin stuff.

On Fri, Jan 4, 2013 at 10:47 AM, Clinton Freeman
notifications@github.comwrote:

I can reproduce the error by just #include at the top of any file in the
Radiant project, then somewhere in the file adding std::vector testVec;

Here are the errors when I did the above in gtkmisc.cpp

1>gtkmisc.cpp(70): error C2039: 'vector' : is not a member of 'std'
1>gtkmisc.cpp(70): error C2143: syntax error : missing ';' before '<'


Reply to this email directly or view it on GitHubhttps://github.com/TTimo/GtkRadiant/issues/147#issuecomment-11889850.

Contributor

freemancw commented Jan 4, 2013

Oh okay, great! If I don't include and just write vector everything works fine. Thanks!

@TTimo TTimo closed this Jan 4, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment