Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Xcode build errors: Lambda capture...not used


Recently I started getting errors about metal shaders not being found in Unreal due to Xcode being out of date. I recently upgraded to High Sierra and the latest Xcode and now i'm unable to open my .uproject file.

I tried deleting binaries, intermediate, saved and the workspace file, then regenerating the workspace file. Now when I try to build from Xcode I get the following build errors:

Lambda capture 'LocalMapLayoutForCapture' is not used (UnrealType.h) (this error appears twice) Lamdba capture 'LocalSetLayoutForCapture' is not used (UnrealType.h)

I'm not sure how to deal with these errors - I've never seen them before. I was tempted to go and delete them from the UnrealType.h file but don't want to mess anything up within the engine code.

Using UE4.18.3 and Xcode 9.3.The project was a C++ project and was compiling just fine until it started saying Xcode was the wrong version and giving me the metal shader errors.

Anyone know how to get around this? :) Thanks

Product Version: UE 4.18
more ▼

asked Apr 15 '18 at 04:52 PM in C++ Programming

avatar image

145 6 6 12

avatar image M.wmmn Apr 15 '18 at 05:10 PM

alt text

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

I also run into this errors generated from [-Werror,-Wunused-lambda-capture] setting using Xcode 9.3 and was able to work around it with downgrading to Xcode 9.0.

As an alternative you could also consider to modify UEBuildTool in such a way that the compiler handles unused lambda captures only as warnings, what shouldn't be a big issue anyways as they just should be optimised out.

more ▼

answered Apr 16 '18 at 04:06 PM

avatar image

j.mueller RFG
304 3 10 10

avatar image SalihBalkan Sep 29 '18 at 01:11 PM

Thank you VERY VERY VERY MUCH MAN. It is fixed by downgrading from Xcode 9.4.1 to 9.0.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

You need to change MacToolChain.cs in UnrealBuildTool to not treat unused captures as errors.

Find the following line:

 Result += " -Wno-unused-value";

and below add

 Result += " -Wno-unused-lambda-capture";

then you have to rebuild UnrealBuildTool by cd-ing into Engine/Source/Programs/UnrealBuildTool and execute the following command

 xbuild UnrealBuildTool.csproj

When that's complete (with a bunch of other unused warnings) you can head back and re-run Build.sh which should complete without errors.

more ▼

answered May 23 '18 at 11:26 AM

avatar image

36 2 6

avatar image leadermax Jul 04 '18 at 10:30 AM

i did exactly as explained but continued getting the same error: lambda capture 'LocalMapLayoutForCapture' is not used [-Werror,-Wunused-lambda-capture] . Does the fact that i'm compiling via remote from windows changes something?

avatar image sshhii Apr 02 '19 at 09:29 AM

try build AutomationTool after building UnrealBuildTool.

avatar image OoKushoO Sep 07 '18 at 12:53 PM

Hey guys , iam facing the similar issue with unreal engine 4.17 on mac, my xcode version 4.3 while using your solution to compile the project , i was not able to find xbuild command on my mac , can you please guide me about the whole process. and how can i run xbuild command in mac.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question