wb2osz / direwolf

Dire Wolf is a software "soundcard" AX.25 packet modem/TNC and APRS encoder/decoder. It can be used stand-alone to observe APRS traffic, as a tracker, digipeater, APRStt gateway, or Internet Gateway (IGate). For more information, look at the bottom 1/4 of this page and in https://github.com/wb2osz/direwolf/blob/dev/doc/README.md
GNU General Public License v2.0
1.56k stars 305 forks source link

Can't build on Windows #469

Closed iontodirel closed 11 months ago

iontodirel commented 1 year ago

I am trying to build Direwolf on Windows with cygwin. Compile succeeds, but link fails with multiple `re_syntax_options' redefinitions. Build log attached.

EDIT: here are my settings

Windows details (Windows version and if it's 32 or 64bit): Windows 11 21H2, 22000.1817, 64-bit What version of Cygwin mingw? 32 or 64bit? 3.4.6, 64-bit What version of direwolf are you trying to compile? 64-bit direwolf Did you install all the dependencies and environment variables for Windows compiling per https: github.com/wb2osz/direwolf/blob/dev/doc/User-Guide.pdf yes, there are no failures due to missing dependencies

Build log: log.txt

dranch commented 1 year ago

You haven't provided enough information to confirm/deny this is a bug:

iontodirel commented 1 year ago

I apologize, I will provide them briefly.

EDIT:

Windows details (Windows version and if it's 32 or 64bit): Windows 11 21H2, 22000.1817, 64-bit What version of Cygwin mingw? 32 or 64bit? 3.4.6, 64-bit What version of direwolf are you trying to compile? 64-bit direwolf Did you install all the dependencies and environment variables for Windows compiling per https://github.com/wb2osz/direwolf/blob/dev/doc/User-Guide.pdf yes, there are no failures due to missing dependencies

dranch commented 1 year ago

Are you trying to compile Direwolf 1.6 (master GIT branch) or Direwolf 1.7G (DEV Git branch)?

wb2osz commented 1 year ago

This clearly has something to do with the regular expression (regex) library. On Linux, direwolf uses the version of regex supplied by the operating system. A copy of regex is included for use on Windows where it does not exist. The error message mentions duplicate definition of something from the regex library I have Windows 10 here, and the versions of cygwin and mingw are not up to date.

This seems to be the culprit: REGEX_VARIABLE_IMPEXP reg_syntax_t re_syntax_options; Maybe something about multiple definitions of the same external variable has changed.

wb2osz commented 1 year ago

Try this:

Edit external/regex/regex.h

Change from: REGEX_VARIABLE_IMPEXP reg_syntax_t re_syntax_options;

Change to: extern reg_syntax_t re_syntax_options;

Let me know how it goes.

73, john WB2OSZ

iontodirel commented 1 year ago

I will try that tomorrow, thank you. And that seems like the right fix.

wb2osz commented 1 year ago

Any results?

iontodirel commented 1 year ago

Hi @wb2osz, that worked! And tested that Direwolf works.

@wb2osz, one other question, I assume that MSVC is not supported anymore? I see references to it in the CMake build scripts, but the C code itself is written in a way that would not compile with MSVC.

wb2osz commented 1 year ago

I'm glad to hear that you were able to build it OK.

The cmake scripts were provided by someone else and they have extra stuff, from other projects, in there that we really don't need. I've only tried using gnu and clang compilers to make portability easier. I have no idea how much effort would be needed to make direwolf build with MSVC. It probably wouldn't be too horrible because it is using the windows header files and C runtime API. Compiler options would definitely need to be changed.

wb2osz commented 11 months ago

Issue resolved. No discussion for many months.