ola
ola copied to clipboard
Errors building on windows with MSYS2
I'm trying to build OLA on Windows with MSYS2. I've been following this guide:
https://wiki.openlighting.org/index.php/Building_OLA_for_Windows
The
autoreconf -i -f
and
./configure --enable-python-libs --disable-e131 --disable-karate --disable-milinst --disable-renard --disable-spi --disable-stageprofi --disable-usbpro --disable-usbdmx --disable-uart
commands worked, but when I run make, I'm getting the following errors:
In file included from ./include/ola/io/SelectServer.h:30,
from ./include/ola/client/ClientWrapper.h:41,
from examples/ola-client.cpp:27:
./include/ola/thread/Thread.h:38:40: error: 'ptw32_handle_t' does not name a type
38 | const ptw32_handle_t &handle) {
| ^~~~~~~~~~~~~~
./include/ola/thread/Thread.h: In function 'std::ostream& operator<<(std::ostream&, const int&)':
./include/ola/thread/Thread.h:39:20: error: request for member 'p' in 'handle', which is of non-class type 'const int'
39 | stream << handle.p;
| ^
and
examples/ola-client.cpp: In function 'void ListPorts(const std::vector<_Tp>&, bool)':
examples/ola-client.cpp:116:31: error: ambiguous overload for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'int')
116 | cout << ", priority " << static_cast<int>(port_iter->Priority());
| ~~~~~~~~~~~~~~~~~~~~~ ^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | int
| std::basic_ostream<char>
and
examples/ola-client.cpp:123:31: error: ambiguous overload for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'int')
123 | cout << "override " << static_cast<int>(port_iter->Priority());
| ~~~~~~~~~~~~~~~~~~~ ^~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | int
| std::basic_ostream<char>
Can anyone help with this? Thanks!
Hi @johnroper100 ,
Our docs here are probably more recent: https://github.com/OpenLightingProject/ola/blob/master/README.mingw32
However someone has also been working on updating those docs: https://github.com/danielskeenan/ola-website/blob/master/download_and_install/_ola_on_windows_msys2.md
It sounds like @danielskeenan had the same issues you're seeing: https://github.com/OpenLightingProject/website/pull/14#issuecomment-781726615
It seems like I might not have done any Win fixes since 2018, although I thought I might have tried compiling it since then (but on mingw32 still).
In file included from ./include/ola/io/SelectServer.h:30, from ./include/ola/client/ClientWrapper.h:41, from examples/ola-client.cpp:27: ./include/ola/thread/Thread.h:38:40: error: 'ptw32_handle_t' does not name a type 38 | const ptw32_handle_t &handle) { | ^~~~~~~~~~~~~~ ./include/ola/thread/Thread.h: In function 'std::ostream& operator<<(std::ostream&, const int&)': ./include/ola/thread/Thread.h:39:20: error: request for member 'p' in 'handle', which is of non-class type 'const int' 39 | stream << handle.p; | ^
This looks relevant, but I'd hope we can fix it without hacking at system headers: https://github.com/jtv/libpqxx/issues/424
If you comment out those two cout lines, does it get on better with other places where we're using a static_cast
It's been a minute since I tried using ola with Windows (since post-COVID work picked up and I don't normally use Windows). I'm realize I'm at risk of derailing this thread a bit, but since ubuntu 21.10 has landed and we're back in the package repo there, I wonder if ola would work in a docker container? Would require a bit of setup (but probably less than compiling from source) to get the docker engine running, but it might be the best way to get it running on Windows.
Tried it again with the new documentation and am back at the errors I had initially:
and
Any chance there has been progress on this front?