ola icon indicating copy to clipboard operation
ola copied to clipboard

Errors building on windows with MSYS2

Open johnroper100 opened this issue 2 years ago • 3 comments

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!

johnroper100 avatar Oct 26 '21 17:10 johnroper100

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? Just trying to narrow it down a bit...

peternewman avatar Oct 27 '21 00:10 peternewman

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.

danielskeenan avatar Oct 27 '21 00:10 danielskeenan

Tried it again with the new documentation and am back at the errors I had initially:

image

and

image

johnroper100 avatar Apr 14 '22 16:04 johnroper100

Any chance there has been progress on this front?

johnroper100 avatar Feb 22 '23 21:02 johnroper100