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 link zlib(Boost) to the project

Hi everyone,

For my project, I need to link zlib from Boost library to my project.

I followed this tutorial Linking_Static_Libraries_Using_The_Build_System but I end up to get this error : LNK2019: unresolved external symbol.

I spent almost 2 days to resolve this problem by looking on the AnswerHub and on the Google but without success. Here is the full Compilation log

The library Boost is in a folder Plugins at the root of the project. My *.build.cs file looks like that :

 using UnrealBuildTool;
 using System.IO;
 
 public class TestImport : ModuleRules
 {
     private string ModulePath
     {
         get { return Path.GetDirectoryName(RulesCompiler.GetModuleFilename(this.GetType().Name)); }
     }
 
     private string ThirdPartyPath
     {
         get { return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); }
     }
 
     private string PluginsPath
     {
         get { return Path.GetFullPath(Path.Combine(ModulePath, "../../Plugins")); }
     }
 
     public TestImport(TargetInfo Target)
     {
         PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ImageWrapper" });
 
         PrivateDependencyModuleNames.AddRange(new string[] { "RHI", "RenderCore", "ShaderCore" });
 
         LoadLibs(Target);
     }
 
     public bool    LoadLibs(TargetInfo Target)
     {
         bool isLibrarySupported = false;
 
         if ((Target.Platform == UnrealTargetPlatform.Win64) || (Target.Platform == UnrealTargetPlatform.Win32))
         {
             isLibrarySupported = true;
 
             string PlatformString = (Target.Platform == UnrealTargetPlatform.Win64) ? "x64" : "x86";
             string LibrariesPath = Path.Combine(PluginsPath, "Boost", "lib", PlatformString);
 
             PublicLibraryPaths.Add(LibrariesPath);
             PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libboost_iostreams-vc120-mt-1_57.lib"));
             PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libboost_zlib-vc120-mt-gd-1_57.lib"));
         }
 
         if (isLibrarySupported)
         {
             PublicIncludePaths.Add(Path.Combine(PluginsPath, "Boost", "include"));
         }
 
         Definitions.Add(string.Format("WITH_BOOST_BINDING={0}", isLibrarySupported ? 1 : 0));
 
         return isLibrarySupported;
     }
 }
 

In a standalone C++ project, it works perfectly with Boost Library and zlib but the integration in UE is quite awfull

If someone has some tips for me, it would be great ! :)

Thanks !

Product Version: Not Selected
Tags:
more ▼

asked Apr 03 '15 at 04:26 PM in C++ Programming

avatar image

Blue Ninja
31 2 4 5

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

1 answer: sort voted first

Problem resolved, I used the wrong .lib file. Now it work perfectly with Boost Library.

more ▼

answered Apr 07 '15 at 02:55 PM

avatar image

Blue Ninja
31 2 4 5

avatar image None94 Jul 25 '15 at 11:17 PM

I face the same question, so which is the right .lib file? Thanks a lot.

(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