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"

Add compiler option (Windows)

Hi everyone,

I tried to look for the way to add compiler option to my project, but I didn't find anything very clear about it. Some people tell to modify files which doesn't exist, other tell that you need to build UBT yourself. I can't believe there are no easy way to do this but I don't find the proper documentation about it.

I actually want to add /MD to the compiler command line. The reason around this is that I'm using OpenCV and cv::findCountours, which need this flag to work properly (otherwise you face some memory issues).

Thanks for reading. Best regards.


So I found out that we can add some compilier/linker options using:

 public override void SetupGlobalEnvironment(
         TargetInfo Target,
         ref LinkEnvironmentConfiguration OutLinkEnvironmentConfiguration,
         ref CPPEnvironmentConfiguration OutCPPEnvironmentConfiguration
         OutCPPEnvironmentConfiguration.AdditionalArguments = "/MD";

in the PROJECT.Target.cs file. However, the documentation says

The current games do not contain this function, as the UEBuildGame class takes care of their needs by default. However, if a game needed to override these settings, it certainly can do so.

So I'm not sure what it means. Actually, The SetupGlobalEnvironment function is never called during the build process :(

Oh and "it certainly can do so"... yeah but the point of a documentation is to explain how. So please Epic fix this part :D

Product Version: UE 4.13
more ▼

asked Nov 09 '16 at 02:53 PM in C++ Programming

avatar image

692 32 22 56

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

1 answer: sort voted first

I finally ended by downloading the UBT source and compile it myself. I also realise that /MD is already enabled.

I really wonder why Epic remove the call to SetupGlobalEnvironment function though. That sounds like "This function call causes an issue, but we don't know how to fix it, let's just remove this usefull feature for now" :D

If someone needs more explanation, let me know.

Best regards.

more ▼

answered Nov 10 '16 at 01:25 PM

avatar image

692 32 22 56

(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