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

Errors building on windows with MSYS2 #1747

Open
johnroper100 opened this issue Oct 26, 2021 · 4 comments
Open

Errors building on windows with MSYS2 #1747

johnroper100 opened this issue Oct 26, 2021 · 4 comments

Comments

@johnroper100
Copy link

johnroper100 commented Oct 26, 2021

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!

@peternewman
Copy link
Member

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:
OpenLightingProject/website#14 (comment)

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:
jtv/libpqxx#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...

@danielskeenan
Copy link
Contributor

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.

@johnroper100
Copy link
Author

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

image

and

image

@johnroper100
Copy link
Author

Any chance there has been progress on this front?

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

No branches or pull requests

3 participants