Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile #1

Closed
f0086 opened this issue Aug 1, 2018 · 1 comment
Closed

Can't compile #1

f0086 opened this issue Aug 1, 2018 · 1 comment

Comments

@f0086
Copy link

f0086 commented Aug 1, 2018

I compiled straight from git HEAD:

...
In file included from ../../../src/core/Core.h:10,
                 from ../../../src/core/Core.cpp:7:
../../../src/core/World/Section.h:97:15: error: ‘function’ in namespace ‘std’ does not name a template type
  typedef std::function<void()> TaskFunc;
               ^~~~~~~~
../../../src/core/World/Section.h:97:10: note: ‘std::function’ is defined in header ‘<functional>’; did you forget to ‘#include <functional>’?
../../../src/core/World/Section.h:18:1:
+#include <functional>
 #endif
../../../src/core/World/Section.h:97:10:
  typedef std::function<void()> TaskFunc;
          ^~~
../../../src/core/World/Section.h:109:17: error: ‘TaskFunc’ has not been declared
   void add_task(TaskFunc task) { m_task_queue.push(task); }
                 ^~~~~~~~
../../../src/core/World/Section.h:113:17: error: ‘TaskFunc’ was not declared in this scope
   LocklessQueue<TaskFunc> m_task_queue;
                 ^~~~~~~~
../../../src/core/World/Section.h:113:17: note: suggested alternative: ‘Task’
   LocklessQueue<TaskFunc> m_task_queue;
                 ^~~~~~~~
                 Task
../../../src/core/World/Section.h:113:25: error: template argument 1 is invalid
   LocklessQueue<TaskFunc> m_task_queue;
                         ^
../../../src/core/World/Section.h: In member function ‘void toy::QueueSection::add_task(int)’:
../../../src/core/World/Section.h:109:47: error: request for member ‘push’ in ‘((toy::QueueSection*)this)->toy::QueueSection::m_task_queue’, which is of non-class type  int’
   void add_task(TaskFunc task) { m_task_queue.push(task); }
                                               ^~~~
EventFilter.cpp
make[1]: *** [toy.make:836: ../../linux64_gcc/obj/x64/Debug/toy/src/core/Core.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [Makefile:93: toy] Error 2

Looks like some C++ version mismatch?

└─ $ ▶ g++ --version
g++ (GCC) 8.1.1 20180531
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@hugoam
Copy link
Owner

hugoam commented Aug 1, 2018

Fixed: 8064852
I suppose depending on the standard library version, <functional> was already included by another of the std headers included by that file, but not with the one you're using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants