Closed cuinjune closed 3 years ago
Did OF stop including pthread with its sources for windows? In any case, you need to find where the header is and include a path to its folder in the header search paths.
If you don’t know what that means, read up on how to include libraries in C/C++ and Visual Studio.
Dan Wilcox danomatika.com robotcowboy.com
On Jun 18, 2019, at 10:15 AM, Zack Lee notifications@github.com wrote:
I tried building ofxPd using Visual Studio 2017 on Windows 10 but it fails with the following error:
Cannot open include file: 'pthread': No such file or directory
I followed every instructions in your README but I could not build it. (I tried on 32bit and 64bit) I could build it successfully last year using OF 0.9.8 but not this time.
I tried using both pd 0.48.2 and 0.49.0 (I tried building libpd based on each sources) I also put libwinpthread-1.dll inside project's bin folder but I don't know why pd's source files cannot include "pthread.h".
Do you have any idea how to fix this? Any advice would be appreciated!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
I figured out how to build ofxPd using Visual Studio 2017 on Windows 10. I tested the following using pd-0.49.0.
pthreadVC2.lib
and pthreadVC2.dll
from https://sourceware.org/pub/pthreads-win32/dll-latest/ (x64 and x86 respectively)libpd.lib
and pd.dll
. (x64 and x86 respectively)libpd.lib
and pthreadVC2.lib
inside your custom directories such as ofxPd\libs\libpd\lib\Win32
and ofxPd\libs\libpd\lib\Win64
.pd.dll
, pthreadVC2.dll
and libwinpthread-1.dll
(find this from libpd\libs
folder) inside yourProject\bin
folder.Debug
-> Properties
-> Linker
-> Input
section and add the custom paths like the following in Additional Dependencies
:
..\..\..\addons\ofxPd\libs\libpd\lib\(Win32 or Win64)\libpd.lib
..\..\..\addons\ofxPd\libs\libpd\lib\(Win32 or Win64)\pthreadVC2.lib
Debug
-> Properties
-> C/C++
-> Preprocessor
section and add the followings in Preprocessor defines
PD
PD_INTERNAL
HAVE_STRUCT_TIMESPEC
Debug
-> Properties
-> C/C++
-> Advanced
-> Compile As
is set to Default
.Project
-> Manage Nuget Packages
, In browse Tab search for pthread
then select Install[Search Results in Nuget packages].x_vexp_fun.c
from ofxPd\libs\libpd\pure-data\src
and find the following code in line 540.
#ifdef _MSC_VER
/* rint is now advertised as part of the microsoft SDK but my MSVC still
doesn't find it - so here it is again. */
static double rint(double x)
{
return (floor(x + 0.5));
}
#endif
Change the code to the following:
#ifdef _WIN32
#if _MSC_VER < 1900
/* rint is now advertised as part of the microsoft SDK but my MSVC still
doesn't find it - so here it is again. */
static double rint(double x)
{
return (floor(x + 0.5));
}
#endif
#endif
pd~.c
from ofxPd\libs\libpd\pure-data\extra\pd~
and find the following code in line 29.
#ifdef _MSC_VER
#pragma warning (disable: 4305 4244)
#define snprintf sprintf_s
#define stat _stat
#endif
Change the code to the following:
#ifdef _WIN32
#if _MSC_VER < 1900
#pragma warning (disable: 4305 4244)
#define snprintf sprintf_s
#define stat _stat
#endif
#endif
This should be smoother as newer versions of the Pd source build much better within Visual Studio and info has been added about how to do this for ofxPd: https://github.com/danomatika/ofxPd#adding-libpd-to-a-visual-studio-project
I tried building ofxPd using Visual Studio 2017 on Windows 10 but it fails with the following error:
I followed every instructions in your
README
but I could not build it. (I tried on 32bit and 64bit) I could successfully build ofxPd last year using OF 0.9.8 but not this time with OF 0.10.1 on Windows.I tried using both pd 0.48.2 and 0.49.0 (I tried building
libpd
based on each sources) I also putlibwinpthread-1.dll
inside project'sbin
folder but I don't know why pd's source files cannot include "pthread.h".Do you have any idea how to fix this? Any advice would be appreciated!