Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode does not add c++ source files that are in subdirectories into Compile Sources

Tags:

c++

xcode

xcode5

I use XCode 5.1 for C++ development. I have existing code which I add to the project by dragging files from Finder. The project shows all necessary .h and .cpp files. But when I click Build Phases->Compile Sources, I only see sources that from the root directory in my source structure. None of the source files from subdirectories appear in the Compile Sources. Why? And how to fix this?

Also, when I try to add the missing .cpp file from Build Phases->Compile Sources by pressing +, XCode does not expand the subdirectories, so I cannot select the missing .cpp files.

like image 673
Narek Avatar asked Jul 11 '14 13:07

Narek


1 Answers

This is unbelievable. The only problem was that I was adding folder structure with Create folder references for any added folders option instead of Create groups for any added folders.

But still don't understand what is the difference in terms of recognition of source files.

Other peculiarity is that you should add resource files in opposite way (Create folder references for any added folders). Otherwise the iOS application does not find the files and does not compile.

like image 108
Narek Avatar answered Nov 09 '22 07:11

Narek