[osg-users] osgQT - Windows 10 pthread.h - not found
Paul McIntosh
paul.mcintosh at internetscooter.com
Wed Nov 16 20:25:32 PST 2016
Hi All,
I am trying to get the new osgQT (https://github.com/openscenegraph/osgQt) building but I am having trouble with threading on Windows
Code:
Looking for pthread.h
Looking for pthread.h - not found
Found Threads: TRUE
Found OpenGL: opengl32
CMake Error at CMakeLists.txt:452 (INCLUDE):
include could not find load file:
Find3rdPartyDependencies
Configuring incomplete, errors occurred!
I tried adding the CMAKE_USE_WIN32_THREADS_INIT directive that is used elsewhere in osg with no luck..
Code:
# Okay, here's the problem: On some platforms, linking against OpenThreads
# is not enough and explicit linking to the underlying thread library
# is also required (e.g. FreeBSD). But OpenThreads may be built with different
# backends (Pthreads, Sproc, Windows) so we don't know what the underlying
# thread library is because some platforms support multiple backends (e.g.
# IRIX supports Sproc and Pthreads). Linking all libraries won't work
# because the libraries may be incompatible.
# So the current solution is to attempt best guess linking and exempt certain
# cases. With IRIX, we're going to hope explicit linking to the underlying
# library is not necessary. We currently don't case for pthreads on Windows
# which might be an issue on things like Cygwin. This may need to be fixed.
# I added this
IF(CMAKE_SYSTEM MATCHES "Windows")
SET(CMAKE_USE_WIN32_THREADS_INIT 1)
ENDIF(CMAKE_SYSTEM MATCHES "Windows")
FIND_PACKAGE(Threads)
Has anyone worked around this issue yet?
Cheers,
Paul
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=69410#69410
More information about the osg-users
mailing list