faup icon indicating copy to clipboard operation
faup copied to clipboard

Windows build instructions

Open pingzing opened this issue 5 years ago • 2 comments

Hi! I'm trying to use this library on Windows, but the build instructions are written for a Linux machine. I can see that the project is supposed to work on Windows, as cmake <repo dir> generates a bunch of Visual Studio projects and a .sln file, but attempting to build any of those fails (usually because something that doesn't exist on Windows is defined).

Can this project be built on Windows?

pingzing avatar Mar 18 '21 21:03 pingzing

I think we need some work to be able to build it under Windows. There was an old version, maybe 1.2 which was windows compatible. Do you have the list of all the errors you are having? This way I could fix it and then we could provide a Windows version. Thanks!

stricaud avatar Mar 20 '21 18:03 stricaud

There's a bunch, and I'm not sure how many of them are just a result of some build flags not quite working correctly. I'll try to summarize:

  • There seems to be an issue with the MINIZ_EXPORT macro used by the miniz headers. Usage of the macro triggers an expected a type specifier error, and the token after it triggers an expected '{' error. This triggers tons of compilation errors in most of the projects.
  • unistd.h doesn't exist on windows, and it's used in a few places, like snapshot-file.c or utils.c.
  • Same for dirent.h.
  • Same for ftw.h.
  • bsd-snprintf.c reports that function 'int snprintf(char *const ,const size_t,const char *const ,...)' already has a body. I think snprintf one may be part of Microsoft's C runtime, and CMake just doesn't set the #define correctly, so it gets defined again here.

pingzing avatar Mar 21 '21 13:03 pingzing