You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm facing compile errors with MInGW GCC 9.2 at Windows in basic_demo.cpp, cross_thread_calls.cpp and cross_thread_calls.cpp, because using vdk::signal conflicts then with x86_64-w64-mingw32/include/signal.h:60:24: note: previous declaration 'void (* signal(int, __p_sig_fn_t))(int)'
---------- ERRORS occurred while compiling file D:\git\s7p\work3\s7p.base\vdk\signals-master\demo\basic_demo.cpp
D:/git/s7p/work3/s7p.base/vdk/signals-master/demo/basic_demo.cpp:13:12: error: 'template<class> class vdk::signal' conflicts with a previous declaration
13 | using vdk::signal;
| ^~~~~~
In file included from D:\git\s7p\work3\s7p.tools/win64_gcc_mingw64_9.2.0/x86_64-w64-mingw32/include/pthread.h:68,
from D:\git\s7p\work3\s7p.tools/win64_gcc_mingw64_9.2.0/include/c++/9.2.0/x86_64-w64-mingw32/bits/gthr-default.h:35,
from D:\git\s7p\work3\s7p.tools/win64_gcc_mingw64_9.2.0/include/c++/9.2.0/x86_64-w64-mingw32/bits/gthr.h:148,
from D:\git\s7p\work3\s7p.tools/win64_gcc_mingw64_9.2.0/include/c++/9.2.0/ext/atomicity.h:35,
from D:\git\s7p\work3\s7p.tools/win64_gcc_mingw64_9.2.0/include/c++/9.2.0/bits/ios_base.h:39,
from D:\git\s7p\work3\s7p.tools/win64_gcc_mingw64_9.2.0/include/c++/9.2.0/ios:42,
from D:\git\s7p\work3\s7p.tools/win64_gcc_mingw64_9.2.0/include/c++/9.2.0/ostream:38,
from D:\git\s7p\work3\s7p.tools/win64_gcc_mingw64_9.2.0/include/c++/9.2.0/iostream:39,
from D:/git/s7p/work3/s7p.base/vdk/signals-master/demo/demo.h:10,
from D:/git/s7p/work3/s7p.base/vdk/signals-master/demo/basic_demo.cpp:7:
D:\git\s7p\work3\s7p.tools/win64_gcc_mingw64_9.2.0/x86_64-w64-mingw32/include/signal.h:60:24: note: previous declaration 'void (* signal(int, __p_sig_fn_t))(int)'
60 | __p_sig_fn_t __cdecl signal(int _SigNum,__p_sig_fn_t _Func);
| ^~~~~~
D:/git/s7p/work3/s7p.base/vdk/signals-master/demo/basic_demo.cpp: In function 'void signals_basic_demo()':
D:/git/s7p/work3/s7p.base/vdk/signals-master/demo/basic_demo.cpp:55:12: error: expected primary-expression before 'void'
55 | signal<void(int)> sig;
| ^~~~
D:/git/s7p/work3/s7p.base/vdk/signals-master/demo/basic_demo.cpp:58:5: error: 'sig' was not declared in this scope
58 | sig.connect(function);
| ^~~
After removing using vdk::signal and adding vdk:: to signal<void(const string &)> sig; it works then.
The text was updated successfully, but these errors were encountered:
Hi, thanks for pointing that out. In fact, this error is weird: signal mentioned in the error message is supposed to be in std namespace. I don't see how they may conflict. Anyway, I will just remove using declarations in demo files to fix the problem.
anb0s
added a commit
to anb0s/signals
that referenced
this issue
Dec 3, 2019
Hi, thanks for pointing that out. In fact, this error is weird: signal mentioned in the error message is supposed to be in std namespace. I don't see how they may conflict. Anyway, I will just remove using declarations in demo files to fix the problem.
It looks like it comes from demo.h:10 --> iostream:39 --> ... --> pthread.h:68 --> signal.h:60, so here we have the declaration of void (* signal(int, __p_sig_fn_t))(int) without any std namespace etc., because it's C / POSIX and not C++.
I've also no idea how to avoid it and created an PR as you also described.
I'm facing compile errors with MInGW GCC 9.2 at Windows in
basic_demo.cpp, cross_thread_calls.cpp and cross_thread_calls.cpp
, becauseusing vdk::signal
conflicts then withx86_64-w64-mingw32/include/signal.h:60:24: note: previous declaration 'void (* signal(int, __p_sig_fn_t))(int)'
After removing
using vdk::signal
and addingvdk::
tosignal<void(const string &)> sig;
it works then.The text was updated successfully, but these errors were encountered: