Page MenuHomeWildfire Games

Fix reported compilation error on arch introduced by rP23917
ClosedPublic

Authored by wraitii on Aug 4 2020, 8:12 AM.

Details

Summary

User navigo_ps91 reports a compilation error in the forums following rP23917.

Clogger uses std::deque but doesn't include it, which seems like a mistake.
I'm not sure why it fails on Arch since the RLInterface project doesn't use PCH, so it should make no difference, but that seems untrue :P

==== Building rlinterface (release) ====
Creating obj/rlinterface_Release
RLInterface.cpp
In file included from ../../../source/rlinterface/RLInterface.cpp:28:
../../../source/ps/CLogger.h:104:7: error: ‘deque’ in namespace ‘std’ does not name a template type
  104 |  std::deque<RenderedMessage> m_RenderMessages;
      |       ^~~~~
../../../source/ps/CLogger.h:28:1: note: ‘std::deque’ is defined in header ‘<deque>’; did you forget to ‘#include <deque>’?
   27 | #include "third_party/fmt/format.h"
  +++ |+#include <deque>
   28 | 
make[1]: *** [rlinterface.make:129: obj/rlinterface_Release/RLInterface.o] Error 1
make: *** [Makefile:83: rlinterface] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
Test Plan

Compile the game.

Event Timeline

wraitii created this revision.Aug 4 2020, 8:12 AM
Vulcan added a comment.Aug 4 2020, 8:51 AM

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/ps/CLogger.h
|   1| /*·Copyright·(C)·2019·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2020" year instead of "2019"

source/ps/CLogger.h
|  47| class·CLogger
|    | [MAJOR] CPPCheckBear (syntaxError):
|    | Code 'classCLogger{' is invalid C code. Use --std or --language to configure the language.
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/2863/display/redirect

wraitii requested review of this revision.Aug 4 2020, 8:51 AM
Itms added a subscriber: Itms.

Wouldn't it be better to include it in RLInterface.cpp? It is when compiling that file that the inclusion is missing. I am a bit confused by the issue, just as I was confused during the review ?

In D2928#127191, @Itms wrote:

Wouldn't it be better to include it in RLInterface.cpp? It is when compiling that file that the inclusion is missing. I am a bit confused by the issue, just as I was confused during the review ?

I would argue that Clogger.h uses std::deque, so including it there (like <mutex>, also used in Clogger.h) makes sense.

Nescio added a subscriber: Nescio.Aug 4 2020, 12:08 PM

RLInterface.cpp has

#include <queue>

Does it actually use it? Or should it be <deque>?

Adding the missing include fixes the issue for me. Good catch, @Nescio about the unused includes - those were left over from an earlier version that I forgot to remove :/

Upon closer inspection, there are a couple other unused includes that could be removed from RLInterface.cpp. Since these should be changed but are unrelated to the reported compilation issue, I removed them in https://code.wildfiregames.com/D2930.

irishninja accepted this revision.Aug 4 2020, 4:36 PM
This revision is now accepted and ready to land.Aug 4 2020, 4:36 PM
This revision was automatically updated to reflect the committed changes.