Unable to compile shipping build with logging in 4.18.1

Hi,

I tried to enable shipping build logging in 4.18.1 but I get still linker errors

UATHelper: Packaging (Windows
(64-bit)): Creating library
E:\FallOfChulua\Binaries\Win64\FallOfChulua-Win64-Shipping.lib
and object
E:\FallOfChulua\Binaries\Win64\FallOfChulua-Win64-Shipping.exp
UATHelper: Packaging (Windows
(64-bit)): SaveGameComponent.cpp.obj :
error LNK2001: unresolved external
symbol “struct FLogCategoryLogTemp
LogTemp”
(?LogTemp@@3UFLogCategoryLogTemp@@A)
UATHelper: Packaging (Windows
(64-bit)): SaveGameController.cpp.obj
: error LNK2001: unresolved external
symbol “struct FLogCategoryLogTemp
LogTemp”
(?LogTemp@@3UFLogCategoryLogTemp@@A)
UATHelper: Packaging (Windows
(64-bit)): QuestController.cpp.obj :
error LNK2001: unresolved external
symbol “struct FLogCategoryLogTemp
LogTemp”
(?LogTemp@@3UFLogCategoryLogTemp@@A)
UATHelper: Packaging (Windows
(64-bit)): SaveGameController.cpp.obj
: error LNK2001: unresolved external
symbol “struct
FLogCategoryLogSerialization
LogSerialization” (?
LogSerialization@@3UFLogCategoryLogSerialization@@A)
UATHelper: Packaging (Windows
(64-bit)): LibTrelloBugReport.cpp.obj
: error LNK2001: unresolved external
symbol “struct FLogCategoryLogJson
LogJson”
(?LogJson@@3UFLogCategoryLogJson@@A)
UATHelper: Packaging (Windows
(64-bit)):
E:\FallOfChulua\Binaries\Win64\FallOfChulua-Win64-Shipping.exe
: fatal error LNK1120: 3 unresolved
externals

I added the “bUseLoggingInShipping” in my “FallOfChulua.target.cs” file. There was already a problem reported and it was closed, Therefore I switched over to 4.18 because I really need the logging because of bug which only happens in shipping build. I will stay on 4.18 but I still have no clue why the bug happens. Probably I have to implement my own logging system… :smiley: … No, this has to work.

Kind regards Andre Schaaf-Ledermüller

I too am experiencing this problem.

any updates?

The reason for this happening apparently is if you have any UE_LOG macros in your C++ code. This also includes referencing to UE4 source code which have that macro AFAIK.

1 Like

I knew that much. From what I’ve seen in the code it seems like DECLARE_LOG_CATEGORY doesn’t get defined properly which makes all log categories invalid. Seems like an order of operations issue. Was hoping one of y’alls had a workaround

Sadly no, I’m urgently trying to find a fix but no luck yet. My shipping builds crash on startup, and there’s no way for me to figure out what’s going without logging.

Apparently LogTemp can’t be used in a shipping build, so a potential workaround is just to change all LogTemps to something else. Though it looks like you’re also having issues with LogSerialization

1 Like

I’m also having issues with LogJson & LogSlate.

I’ve removed all logs from my project but I still get errors, this is really weird.

Also have the same issues!

has this ever been resolved for 4.18.2 ? We are experiencing the same issue with various LOG related compier errors when using the above mentioned boolean in the target files.

We are not able to upgrade to another engine for now so ideally we find a way to do this in 4.18.2

I don’t think so. You could try just writing out to a file manually or something

Surprisingly this is still a problem to this day! I was able to (very hackily) circumvent the issue by convincing the linker that the definitions exist in my project in my own log.cpp file

my code is as follows:

#if UE_BUILD_SHIPPING
#include "DataTableUtils.h"
#include "EngineLogs.h"

DEFINE_LOG_CATEGORY(LogJson);
DEFINE_LOG_CATEGORY(LogType);
DEFINE_LOG_CATEGORY(LogPhysics);
DEFINE_LOG_CATEGORY(LogNetPlayerMovement);
DEFINE_LOG_CATEGORY(LogSerialization);
DEFINE_LOG_CATEGORY(LogDataTable);
#endif

Though this may satisfy my project’s linker needs, the needs will likely be different per project, and may not even have been by design by the engineers at Epic!

Additionally, even with all of these things crossed off the list, the log is still not showing up in shipping in Epic’s distributed engine versions… very sad days.
Hopefully you can all figure out what you need and get those shipping logs running.

-Spiris

1 Like

Did the same for our UE5 based binary engine. But like you said, a lot of logs are missing, it’s better to use a source engine instead.