- This topic has 4 replies, 2 voices, and was last updated 8 years, 2 months ago by yincg.
-
AuthorPosts
-
2016-02-14 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 me
2016-02-14 at 11:55 am #892cmath
is usually used in C++ libraries. Xcode will usually only search forcmath
as 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 includescmath
.The
cmath
header is not used by MetalGL. I suspect that you have a header file somewhere in yourUser Header Search Paths
that overrides (has the same name) as a system header file, and that header file is includingcmath
.Check your
User Header Search Paths
Xcode 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 tocmath
.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 support@metalgl.com directly.
…Bill
2016-02-15 at 7:37 am #894i 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 why2016-02-17 at 11:27 pm #897Sorry 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 forcmath
.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) istest_project.m
, which is an Objective-C file.You have a couple of options. The simplest is to change the name of
test_project.m
totest_project.mm
, so that it will be compiled as Objective-C++ and will find thecmath
system 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 (.mm
) files.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_PATHS
turned off on that project target. You only need to set theALWAYS_SEARCH_USER_PATHS
option for code that needs to include thegl.h
orglext.h
files when using MetalGL.…Bill
2016-02-18 at 1:15 am #899Ok,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? -
AuthorPosts
- The forum ‘MoltenGL Support’ is closed to new topics and replies.