February 14, 2016 at 3:52 am #891
My App runs well before i set the Always Search User Paths to Yes.
when i set it to Yes,it comes out a complied problem like ”cmath’ file not found’.
i check out the Xcode Quick Help, it says this Always Search User Paths means the complier will search User Header Search Paths first.
now my question is i just turn that Always Search User Paths flag on,nothing else changed, so as the Xcode Quick Help saies, complier will search User Header Search Paths first, and then search the other place,so why this ”cmath’ file not found’ comes out, it will still check the ‘cmath’ file location.
please help meFebruary 14, 2016 at 11:55 am #892
cmathis usually used in C++ libraries. Xcode will usually only search for
cmathas a system header when it is referenced from a C++ source file. The error you are getting typically arises when a header file included by a non-C++ source file (C, Objective-C or Swift file) indirectly includes
cmathheader is not used by MetalGL. I suspect that you have a header file somewhere in your
User Header Search Pathsthat overrides (has the same name) as a system header file, and that header file is including
User Header Search PathsXcode build setting, the header files included from that path, and the header files included in your Xcode project, to see if that is the case. Within Xcode, you could also search for references to
If you continue to have trouble, ZIP up your Xcode project, upload it to somewhere like Dropbox, post a link to it here, and we’ll have a look at it. If you don’t want to post the link here, you can email the link to email@example.com directly.
…BillFebruary 15, 2016 at 7:37 am #894
i already Emailed you.
and when i use MetalGL in GLAirplay(Apple’s OpenGL Demo) as a test,there comes a crash problem,like this:
please tell me whyFebruary 17, 2016 at 11:27 pm #897
Sorry for the delay in getting back to you. We have been very busy this week with activities associated with the Vulkan public release this week.
If you look at the inclusion order of the error (in the attached image), you can see that the system header chain eventually tries to include a file called
block.h. Unfortunately, your project also contains a file with that name, and it attempts to then include further header files in your project, eventually looking for
As I mentioned above, the compiler does not find
cmath, because it is not looking for C++ files, since the source file it is attempting to compile at the time (see the top of the list in the error) is
test_project.m, which is an Objective-C file.
You have a couple of options. The simplest is to change the name of
test_project.mm, so that it will be compiled as Objective-C++ and will find the
cmathsystem file. This is a sensible thing to do anyway, since your project includes a substantial third-party C++ library, and any Objective-C files that use it will need to be (
The second option (for more complicated projects) is to compile the third-party library in a separate build target within your project, and leave the
ALWAYS_SEARCH_USER_PATHSturned off on that project target. You only need to set the
ALWAYS_SEARCH_USER_PATHSoption for code that needs to include the
glext.hfiles when using MetalGL.
…BillFebruary 18, 2016 at 1:15 am #899
Ok,i got this.
But as you say if i change the file name from .m to .mm,with the setting of Always Search User Paths,the system header which try to include ‘block.h’ will still link to the file of the same name in my project, which what i don’t wanna see(cause i do not wanna change anything except the setting of MetalGL). so is that the only way that i change the file name ‘block’ to solve the problem?
The forum ‘MoltenGL Support’ is closed to new topics and replies.