qlibc
qlibc copied to clipboard
[Question] Windows supported? It seems that CMake doesn't work
- It seems that
pthreads
is required, so I use pthreads for Windows instead. It seems CMakeLists.txt does not work well with find. - 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!
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 Does it mean that MSVC
will not work for qlibc
? Thanks!
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
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
@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 OK, thanks for your reply. I'll have a try when I have time.