irtlab / rtptools

RTP Tools
http://www.cs.columbia.edu/irt/software/rtptools/
Other
165 stars 64 forks source link

build fails on win for 'err.h' #98

Closed mcd500 closed 6 years ago

mcd500 commented 6 years ago

https://github.com/columbia-irt/rtptools/pull/97 is a big step forward of rtptools getting better.

In the transition, It fails to build on Win. 1>d:\documents\dev\rtptools\rtptools-1.23\utils.c(34): fatal error C1083: Cannot open include file: 'err.h': No such file or directory 1>utils.obj : error LNK2019: unresolved external symbol _warnx referenced in function _hpt

Even it fails to build on Win at the moment, moving to err() is great way to go.

Also it has the error message. 1>utils.obj : error LNK2019: unresolved external symbol _inet_aton referenced in function _host2ip Windows do not have inet_aton for some unknown reason, but has inet_pton(). https://stackoverflow.com/questions/2420663/windows-equivalent-of-inet-aton https://msdn.microsoft.com/en-us/library/windows/desktop/cc805844(v=vs.85).aspx

I hope somebody from MS is watching all the discussion this github. :)

mcd500 commented 6 years ago

Win has inet_addr() https://msdn.microsoft.com/en-us/en_us/library/windows/desktop/ms738563(v=vs.85).aspx https://msdn.microsoft.com/ja-jp/library/windows/desktop/ms738563(v=vs.85).aspx

mcd500 commented 6 years ago

No config.h with make dist for win. 2>d:\documents\dev\rtptools\rtptools-1.23\compat-err.c(1): fatal error C1083: Cannot open include file: 'config.h': No such file or directory

I am not sure what would be good way to do it here but since Win needs to include sysdep.h, would it be good to have config.h which includes sysdep.h guarded with ifdef (WIN32)?

janstary commented 6 years ago

Ah, that's right. We can't #include config.h in anything that is to be used by windows. For example compat-err.c if we want to use err().

In fact.t, the sysdep.h is a kind of replacement of config.h for windows: nothing else needs it, it's one huge #if WIN32. So maybe the easiest way is to include either config.h (on normal systems that can create it with ./configure), or sysdep.h (aptly renamed to winconfig.h, because that's what it is).

janstary commented 6 years ago

The first step to fix this is https://github.com/columbia-irt/rtptools/pull/112

janstary commented 6 years ago

https://github.com/columbia-irt/rtptools/pull/114 should fix this

mcd500 commented 6 years ago

Confirmed on Win that #114 have fix this. Thanks.