qlibc icon indicating copy to clipboard operation
qlibc copied to clipboard

[Question] Windows supported? It seems that CMake doesn't work

Open tan-wei opened this issue 5 years ago • 6 comments

  1. It seems that pthreads is required, so I use pthreads for Windows instead. It seems CMakeLists.txt does not work well with find.
  2. If I ignore MESSAGE(FATAL_ERROR "Couldn't find pthreads."), then build process will be fail. One of the error messages come with
E:\DemoProjects\qlibc\src\internal\qinternal.h(64): fatal error C1083: Cannot open include file: 'unist d.h': No such file or directory [E:\DemoProjects\qlibc\build\qlibcext-static.vcxproj]

It seems some POSIX interfaces are required. Does it mean Windows not supported? Thansk!

tan-wei avatar May 18 '19 12:05 tan-wei

you can use cygwin, msys2 or mingw-w64 which all include some kind of pthread wrapper around Microsoft C (_beginthread(3C) etc) and/or Windows NT thread APIs (CreateThread(2)), or compile pthreads-win32 yourself and make it available to CMake somehow

despair86 avatar Oct 08 '19 21:10 despair86

@despair86 Does it mean that MSVC will not work for qlibc? Thanks!

tan-wei avatar Oct 21 '19 13:10 tan-wei

no that was the last option I listed

  • grab https://sourceware.org/pthreads-win32
  • compile and install somewhere that cmake can pick it up later

then Microsoft C might work

despair86 avatar Oct 21 '19 18:10 despair86

I should put in a patch to hide unistd.h from MS C, but I don't use the library myself atm

/* mingw32 has it but not stock MS C or psdk */
#ifndef _MSC_VER
#include <unistd.h>
#endif

despair86 avatar Oct 21 '19 18:10 despair86

@tan-wei replace the NOTFOUND fields for pthread after cmake fails with the path to pthreads-win32 manually, cmake isn't very good at searching for libraries on Windows

despair86 avatar Oct 21 '19 18:10 despair86

@despair86 OK, thanks for your reply. I'll have a try when I have time.

tan-wei avatar Oct 22 '19 06:10 tan-wei