Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 160 Vote(s) - 3.64 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Xcode framework no longer found after second build

#1
Since I upgraded to Xcode 11 every new project I start that includes a framework can be no longer be compiled after the second build of the project.

For example including SDL2 using this command:

#include <SDL2/SDL.h>

will result in this error:

'SDL2/SDL.h' file not found

after the project has been compiled a second time.

Projects that have been created in Xcode 10 work normal in Xcode 11.
I tried changing the embedding options of the frameworks but no setting works. This error occurs in all Xcode 11 versions (0 - 2.1).
I am using macOS Version `10.14.6`.

**Why does this happen or how can this be fixed?**
Reply

#2
SDL2 isn't a framework. Rather it is either a static or dynamic lib. Unless of course you are using some other custom made framework for SDL2.

There are two scenarios you would typically encounter:

1. SDL2 installed in the default location such as /usr/local
2. SDL2 installed in a custom place (which is how I do it)

I am guessing you are doing the former. If this is the case, it is possible that with Xcode 11 the default system header search path has somehow changed to not include /usr/local (or where you have installed it).

To fix this, you should first locate your SDL2 library. In particular where the include files are.

Then in Build Settings, go to Search Paths:System Header Search Paths and enter that path in.

[![Build Settings][2]][2]

Keep in mind the `#include` is using `SDL2` as part of the path, so you do not want to put the `SDL2` part in the path. Here is an example of my directory structure. So my path entry for this is `$(PROJECT_DIR)/3rdParty/SDL2/include`. You can see in my project directory, I have a 3rdParty directory which I use to hold the 3rd Party libs I integrate into the project.

[![Example directory structure][1]][1]


You're using angled brackets for inclusion, which utilizes the system path.

Note you also may have to do update how you link against SDL2 (ie. it may not be able to find it).


[1]:

[2]:
Reply

#3
I hade the same problem with XCode 11.1. What I found out was that I needed to add the Header Search Path in Build Settings/Search Paths to:

/Library/Frameworks/SDL2.framework/Versions/A/Headers

And then it worked. It looks like the path is changed.
Reply

#4
I finally found a solution. I added the frameworks with the menu in this screenshot to my project:

[![enter image description here][1]][1]


In Xcode 9 and 10 this did the same as adding the framework using this menu:

[![enter image description here][2]][2]

But now in Xcode 11 this isn't the same anymore. Adding the framework using the first menu will copy the framework from it's original path into the build folder of the project but for some reason Xcode does **not** copy the `Headers` folder in the framework. I think this is a bug but it seems like they haven't fixed it up to Xcode version `11.2.1` at least.

So now the solution to this problem is adding the framework using the `Build Phases` menu in the second picture.

[1]:

[2]:
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through