x

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"

Can't add ThirdParty source files to project.

When I add my ThirdParty sources inside the Source folder, I get the famous PCH message asking me to put the same include line in every source file. For most libs, this is not possible, because they are used with other projects.

When I put the files outside, on the same level as the Source folder, and add the sources to my XCode project, the build system will remove my link as soon as I use the services command "Generate XCode project", which is needed since the new project structure has been introduced.

Is there a solution to compile 3rd party sources without the need of the standard UE4 PCH?

Building on OSX is a PITA, not talking about the weird behaviour of the error display, the optinization mode and the reset to the UE4 scheme after each generation. Nevertheless - thank you for this great engine, but XCode needs more love. ;)

@see also: https://answers.unrealengine.com/questions/414600/how-to-include-sources-without-pch-include.html#comment-414670-form

Product Version: UE 4.11
Tags:
more ▼

asked May 10 '16 at 08:00 AM in C++ Programming

avatar image

rotwang
241 13 20 41

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

I'm not sure if there is a way to compile without the PCH, I don't think there is as long as you're wanting your source be built by the Unreal Build Tool. I will say that adding files to the Xcode project works exactly the same as a Visual Studio project in that what you add to it does it matter. That project only exists for XCode itself, the Unreal Build Tool doesn't use that information, and instead only looks at the Build.cs files and the directory structure itself.

As far as I know the only way to compile 3rd party source without being forced to use the PCH is by adding it as a 3rd party plugin. In the editor if you got to Edit -> Plugins and add a New Plugin and look for "Third Party Library" for an example.

more ▼

answered May 10 '16 at 08:14 AM

avatar image

Koderz
313 6 7 23

avatar image Matthew J ♦♦ STAFF May 16 '16 at 06:59 PM

Hello,

Has Koderz's answer been of any help to you? If not, please let me know and I'll look into this issue for you.

avatar image rotwang May 16 '16 at 07:45 PM

Koderz, thank you for the info. I had a look into the "Third Party Library" library plugin, but this is Windows only and for dynamic libraries. What I need to do is adding static libraries to my plugins or as a 2nd choice at least add unmodified sources files. @Matthew Would be great to have an option in the Unreal Build Tool, that can use a set of files without Unreal PCH. At least, when I add files OUTSIDE the source folder, the "Generate XCode project" should NOT REMOVE these files from XCode. As Koderz wrote, the build tool doesn't need XCode, so leave my files alone. ;) Thank you for looking into this issue.

avatar image Matthew J ♦♦ STAFF May 17 '16 at 10:28 PM

I began looking into options to do that and came across this post from a while back. I'm not 100% sure if the information is relevant since it is back from 4.6 but please take a look and see if this method may help you.

https://answers.unrealengine.com/questions/157210/thirdparty-static-library-in-mac.html

avatar image rotwang May 18 '16 at 08:19 AM

There is now a solution for static libs in my @see also link mentioned above. For reference: Put the following block into your public MyPlugin(TargetInfo Target) section.

  PublicAdditionalLibraries.AddRange(
         new string[]
         {
               "/path_to_your_library/libHelloWorld.a"
         }
         );
  

The PublicAdditionalLibraries is not included in the plugin templates, I recommend to add it - Unreal can you hear me? Thanks everybody for helping me. @see also: https://answers.unrealengine.com/questions/414600/how-to-include-sources-without-pch-include.html#comment-414670-form .

(comments are locked)
10|2000 characters needed characters left
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