zac-garby / solar-system

A strategy/simulation game.
MIT License
33 stars 17 forks source link

add functional to fix compilation error #15

Closed 0x72D0 closed 7 years ago

zac-garby commented 7 years ago

What does <function> do, and what was the compilation error?

0x72D0 commented 7 years ago

my compilation error was: /home/kts/solar-system/widget.h:74:10: error: ‘function’ in namespace ‘std’ does not name a template type std::function<void ()> callback;

so I did a little research and the functional header was missing, this header include the std::functional. Now I can compile the code.

zac-garby commented 7 years ago

Oh, nice :) Is it necessary to include <functional> in that many files though?

It seems to me the problem is that on some platforms, you need to include <functional> to use the std::function type - however I'm only actually using that type in a handful of files.

0x72D0 commented 7 years ago

I added the fuctional header on every file I receive the compilation error.

zac-garby commented 7 years ago

I think that only about 2 files actually need the include. Could you try removing it from files, and seeing for which ones the error returns?

0x72D0 commented 7 years ago

Yeah sorry I just discover that adding it to widget.h only actually solve this problem... I'm gonna change the pull request

zac-garby commented 7 years ago

Cool, thanks 👍

0x72D0 commented 7 years ago

ok I've got problem with my github repo... I'm gonna open a new pull request...