Answer the question
In order to leave comments, you need to log in
Why doesn't the code compile when connecting vector?
When including the vector library, the code does not compile with an error in several files, for example, alloc_traits.h on the line namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
The error itself looks like this: error:namespace definition is not allowed here
What could be the problem here?
Answer the question
In order to leave comments, you need to log in
Most likely, somewhere in the previous header - in what is in front of ours <vector>
- something is not closed (namespace, function, etc.)
UPD2. It turned out to repeat the error with this code.
void x() {
#include <vector>
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question