Jump to content

did you forget to '#include <deque>'


Recommended Posts

Greetings,

Building 0ad from git again under artix (arch) linux.  Have encountered the following error:

==== 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...

I've searched the forums and tickets, and have come up empty.  Anyone have any suggestions?
 

Link to post
Share on other sites
3 minutes ago, Angen said:

just a note, jenkins is building with pch

I know, but that particular RLInterface project doesn't use pch, so that it makes a difference at all is a bit odd to me, but there's obviously something I'm missing.

Link to post
Share on other sites

For the record, I did just rebuild 0 A.D. from scratch and did not encounter your error (Fedora 32 and gcc 10.2.1 here, not Artix Linux).

Doing a grep shows:

Spoiler

[source]$ grep -r deque
graphics/TextureConverter.h:	std::deque<shared_ptr<ConversionRequest> > m_RequestQueue; // protected by m_WorkerMutex
graphics/TextureConverter.h:	std::deque<shared_ptr<ConversionResult> > m_ResultQueue; // protected by m_WorkerMutex
simulation2/system/TurnManager.h:#include <deque>
simulation2/system/TurnManager.h:	std::deque<std::map<u32, std::vector<SimulationCommand>>> m_QueuedCommands;
ps/CLogger.h:	std::deque<RenderedMessage> m_RenderMessages;
ps/CConsole.h:#include <deque>
ps/CConsole.h:	std::deque<std::wstring> m_deqMsgHistory; // protected by m_Mutex
ps/CConsole.h:	std::deque<std::wstring> m_deqBufHistory;
ps/UserReport.cpp:	std::deque<shared_ptr<CUserReport> > m_ReportQueue;
ps/Loader.cpp:#include <deque>
ps/Loader.cpp:typedef std::deque<LoadRequest> LoadRequests;
ps/CConsole.cpp:	std::deque<std::wstring>::iterator Iter; //History iterator
ps/CConsole.cpp:	std::deque<std::wstring>::reverse_iterator it = m_deqBufHistory.rbegin();
ps/Profiler2GPU.cpp:	std::deque<SFrame> m_Frames;
ps/Profiler2GPU.cpp:	std::deque<SFrame> m_Frames;
ps/Profiler2GPU.cpp:	std::deque<SFrame> m_Frames;
lobby/XmppClient.h:#include <deque>
lobby/XmppClient.h:	std::deque<JS::Heap<JS::Value> > m_GuiMessageQueue;
tools/profiler2/jquery-1.6.4.js:			// Speed up dequeue by getting out quickly if this is just a lookup
tools/profiler2/jquery-1.6.4.js:	dequeue: function( elem, type ) {
tools/profiler2/jquery-1.6.4.js:		// If the fx queue is dequeued, always remove the progress sentinel
tools/profiler2/jquery-1.6.4.js:			// automatically dequeued
tools/profiler2/jquery-1.6.4.js:				jQuery.dequeue(elem, type);
tools/profiler2/jquery-1.6.4.js:				jQuery.dequeue( this, type );
tools/profiler2/jquery-1.6.4.js:	dequeue: function( type ) {
tools/profiler2/jquery-1.6.4.js:			jQuery.dequeue( this, type );
tools/profiler2/jquery-1.6.4.js:				jQuery.dequeue( elem, type );
tools/profiler2/jquery-1.6.4.js:			this.dequeue();
tools/profiler2/jquery-1.6.4.js:				jQuery.dequeue( this );
tools/replayprofile/jquery.js:	dequeue: function( elem, type ){
tools/replayprofile/jquery.js:	dequeue: function(type){
tools/replayprofile/jquery.js:			jQuery.dequeue( this, type );
tools/replayprofile/jquery.js:			this.dequeue();
tools/replayprofile/jquery.js:				jQuery(this).dequeue();
renderer/WaterManager.cpp:	std::vector<std::deque<CoastalPoint> > CoastalPointsChains;
renderer/WaterManager.cpp:		std::deque<CoastalPoint> Chain;
network/NetClient.h:#include <deque>
network/NetClient.h:	std::deque<JS::Heap<JS::Value>> m_GuiMessageQueue;
lib/debug_stl.cpp:#include <deque>
lib/debug_stl.cpp:struct Any_deque : public ContainerBase<std::deque<int> >
lib/debug_stl.cpp:			Any_deque& Container() const
lib/debug_stl.cpp:				return *(Any_deque*)_Mycont;
lib/debug_stl.cpp:		Any_deque& container = it.Container();
lib/debug_stl.cpp:// container = deque as we assume.
lib/debug_stl.cpp:struct Any_queue : public Any_deque
lib/debug_stl.cpp:// container = deque as we assume.
lib/debug_stl.cpp:struct Any_stack : public Any_deque
lib/debug_stl.cpp:	STD_CONTAINER(deque)
lib/debug_stl.cpp:	// (note: Any_queue etc. assumes the underlying container is a deque.
lib/debug_stl.cpp:	CONTAINER(queue, L"std::queue<*,std::deque<*> >")
lib/debug_stl.cpp:	CONTAINER(stack, L"std::stack<*,std::deque<*> >")
lib/pch/pch_stdlib.h:#include <deque>
lib/sysdep/os/win/tests/test_wdbg_sym.h:#include <deque>
lib/sysdep/os/win/tests/test_wdbg_sym.h:		std::deque<int> d_int;
lib/sysdep/os/win/tests/test_wdbg_sym.h:		std::deque<std::string> d_string;
lib/sysdep/os/win/tests/test_wdbg_sym.h:		std::deque<u8> d_u8_empty;
lib/sysdep/os/win/tests/test_wdbg_sym.h:		std::deque<u8> d_u8_uninit;
lib/tests/test_adts.h:		std::deque<int> deq;

 

#include <deque>

is present in the following files:

Spoiler

source/lib/debug_stl.cpp
source/lib/pch/pch_stdlib.h
source/lib/sysdep/os/win/tests/test_wdbg_sym.h
source/lobby/XmppClient.h
source/network/NetClient.h
source/ps/CConsole.h
source/ps/Loader.cpp
source/simulation2/system/TurnManager.h

Whether or not it should be include in any other files is something for people more skilled in C++ than me to investigate and decide.

[EDIT]

#include <queue>

is present in:

Spoiler

source/lib/adts/cache_adt.h
source/lib/file/vfs/vfs_util.cpp
source/lib/pch/pch_stdlib.h
source/lib/sysdep/os/win/tests/test_wdbg_sym.h
source/graphics/ObjectBase.cpp
source/rlinterface/RLInterface.cpp
source/simulation2/components/CCmpTerritoryManager.cpp
source/tools/atlas/GameInterface/Handlers/TerrainHandlers.cpp
source/tools/atlas/GameInterface/MessagePasserImpl.h

Edited by Nescio
<queue>
Link to post
Share on other sites

Not sure how I missed this on the original revision since I also am using arch linux and it was building for me when I was testing it... Regardless, I am able to see the same issue when building from the git mirror.

I just accepted D2928 which adds the missing include and I have addressed the unused includes that @Nescio found in another revision (D2930). Nice catch, @Nescio!

Link to post
Share on other sites
4 hours ago, navigo_ps91 said:

I would like to followup and say the patch adding the #include <deque> worked very well, thank you!

It's been committed now, thanks for reporting :) 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...