Reputation: 47
I solved this problem in Xcode 6.2 by following the advice in previous, similar postings. It has re-appeared in Xcode 6.3 and is not as easily corrected.
I have a mixed, objective-c and c++ project where files that contain c++ code are named *.mm and project settings are at the default. If I load in a small set of c++ files and call a c++ functor from the view controller of a canned single-page iOS application in a new project created to isolate the problem, it compiles successfully. Then, when I try to add a folder containing previously written (and successfully compiled) mixed code, the following error appears.
lexical or preprocessor issue, 'array' file not found
I then tried combinations 'C Language Dialect' and 'C++ Language Dialect' as c11 | gnu11 and c++c11 | gnu++11 | c++c14 in the build settings and the error remained.
Removing the reference to the group of addition files gets the compilation to succeed again and does even if the build setting point to gnu11 or c11.
How does the addition or removal of files (that all compiled under Xcode 6.2) have to do with the compiler finding or not finding the standard template header file?
Upvotes: 0
Views: 1598
Reputation: 47
By adding back the files incrementally, I isolated the problem to a regular objective-c file (myfilename.m) that had an errant include of a C++ header file that I had named 'Vertex.h'. I refactored the C++ header files to have the hpp extension (see the entry '*.h or *.hpp for your class definitions') so finding mistakes like that in the future are a matter of a straightforward unix shell script.
Upvotes: 1