danomatika / ofxPd

(maintained) a Pure Data addon for OpenFrameworks using libpd
Other
202 stars 45 forks source link

_WIN32_WINNT not defined #21

Closed Stefan0 closed 12 years ago

Stefan0 commented 12 years ago

Hello, I've downloaded the latest version of ofxPd from Github repository (danomatika-ofxPd-007-47-g92869c8). When I compile the ofxPd codeblocks example project for Windows I get this error: "undefined reference to `SetDllDirectory'". The declaration of the SetDllDirectory function is in the winbase.h header file (in pure-data/src):

if (_WIN32_WINNT >= 0x0502)

define SetDllDirectory SetDllDirectoryW

endif

and in ofConstants.h (openFrameworks/utils) there is:

ifndef _WIN32_WINNT

    #   define _WIN32_WINNT 0x400

endif

so it seems like _WIN32_WINNT is not defined. I've tested the project on Windows 7 and XP.

My solution is to insert "_WIN32_WINNT=0x0502" in the "#define" section of Codeblocks project build options. Does anyone have the same problem?Is there another way to fix it?

Thank you!

danomatika commented 12 years ago

Has anyone else noticed this on Windows? I haven't on my Win 7 machine.

danomatika commented 12 years ago

Ok, this is fixed. You were right, the newer version of libpd now requires the WINVER define for minigw. I've added this to the example and the readme.

danomatika commented 12 years ago

Here's the libpd makefile, they use WINVER=0x502: https://github.com/libpd/libpd/commit/ed453ffed4d078ef838dace9992f75913b3dcf8a