ntop / n2n

Peer-to-peer VPN
GNU General Public License v3.0
6.19k stars 934 forks source link

CMake build on Windows not possible #913

Closed Logan007 closed 2 years ago

Logan007 commented 2 years ago

It looks like we are having difficulties with the upnp/pmp 3rd party libraries, also see the output CMake runner at Actions tab.

Logan007 commented 2 years ago

Might be different issues:

Logan007 commented 2 years ago

Umm, at least locally, I am able to compile on Windows if I add

#ifdef  _WIN64
typedef unsigned __int64    ssize_t;
#else
typedef _W64 unsigned int   ssize_t;
#endif

to the very beginning of thirdparty/libnatpmp/natpmpc.c file...

Logan007 commented 2 years ago

... and CMake Action runs green with libnatpmp support disabled.

Suggestions are welcome!

hamishcoleman commented 2 years ago

Just for a couple of datapoints:

Logan007 commented 2 years ago

I will try to change the libnatpmp submodule to this commit – keep your fingers crossed!

hamishcoleman commented 2 years ago

we really dont want to change the submodule - that defeats much of the purpose of submodules!

Logan007 commented 2 years ago

To keep a compile-able dev, I see no other option than to disable libnatpmp support on Windows until we come up with a better solution.

hamishcoleman commented 2 years ago

Hrm, perhaps I have misunderstood - what does the libnatpmp part do? with a quick look at the linux cmake build, it seemed like it was not compiled.

If simply removing it from the compile works, then what feature is lost?

Logan007 commented 2 years ago

There are two protocols for enabling port forwarding, upnp and pmp. So, pmp would be lost on pure MSVC WIndows builds (not MinGW as it has uses different compiler I guess).

hamishcoleman commented 2 years ago

oh, but of course. Why have one way that is fragile and takes an entire XML parser, when you could have several!

Logan007 commented 2 years ago

Hereby, f0c37c7 officially is dedicated to you! :wink:

miniupnp commented 2 years ago

ssize_t is SIGNED !

Logan007 commented 2 years ago

Thank you @miniupnp. The exemplary code above was given before we did the deeper dive over at your repo.

Logan007 commented 2 years ago

With upstream libnatpmp being adapted for Windows compile, we can revert #914 and #917. Any objection?