daven11
daven11

Reputation: 3025

XCode upgraded to 4.4.1 and now I get errors compiling in stl <vector>

Upgraded to XCode 4.4.1 and restarted my machine, recompiled and now get the error below when I try to compile - any suggestions? (It used to compile fine) (Running on Lion 10.7.4, XCode Version 4.4.1)

#ifndef MYFILE_H
#define MYFILE_H

#include <vector> <-- this line
#include <typeinfo>
#include <string>
#include "assert.h"

using namespace std;

Error message

In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/usr/include/c++/4.2.1/vector:69:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/usr/include/c++/4.2.1/bits/stl_vector.h:69:1: error: expected member name or ';' after declaration specifiers
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)

Upvotes: 0

Views: 474

Answers (1)

Barney Szabolcs
Barney Szabolcs

Reputation: 12514

If this problem is still actual, I suggest you should check the following project setup lines:

  • C++ Language Dialect (mine: Compiler Default)
  • C++ Standard Library (mine: Compiler Default)
  • Compiler for C/C++/Objective-C (mine: Apple LLVM compiler 4.1)

Not all combinations work and not always the "Compiler Default" is the default. I had some problems, too.

(From the error message it looks for me like you are using libstdc++ instead of libc++ but not the gcc compiler or so. I had similar problem after the update.)

Upvotes: 1

Related Questions