nitgen-bsp icon indicating copy to clipboard operation
nitgen-bsp copied to clipboard

Build nitgen-bsp on Windows

Open luzfcb opened this issue 10 years ago • 1 comments

hi @fiorix, thanks for your hard work on this project. Is possible build nitgen-bsp on Windows?

I have the HamsterDX (model HFDU06) I tried using " eNBSP_SDK_v4.85" for windows

Using Visual C++ 2008 Express:

C:\Users\fabio.luz\Desktop\nitgen\nitgen-bsp>setup.py build
running build
running build_py
running build_ext
building 'NitgenBSP/_bsp_core' extension
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox
/MD /W3 /GS- /DNDEBUG "-ID:\Program Files (x86)\NITGEN eNBSP\SDK\inc" -IC:\Pytho
n27\include -IC:\Python27\PC /TcNitgenBSP/bsp_core.c /Fobuild\temp.win32-2.7\Rel
ease\NitgenBSP/bsp_core.obj
bsp_core.c
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo
/INCREMENTAL:NO /LIBPATH:C:\Python27\libs /LIBPATH:C:\Python27\PCbuild NBioBSP.l
ib /EXPORT:initNitgenBSP/_bsp_core build\temp.win32-2.7\Release\NitgenBSP/bsp_co
re.obj /OUT:build\lib.win32-2.7\NitgenBSP\_bsp_core.pyd /IMPLIB:build\temp.win32
-2.7\Release\NitgenBSP\_bsp_core.lib /MANIFESTFILE:build\temp.win32-2.7\Release\
NitgenBSP\_bsp_core.pyd.manifest
LINK : fatal error LNK1181: cannot open input file 'NBioBSP.lib'
error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\link.
exe"' failed with exit status 1181

Using MinGW gcc:

C:\Users\fabio.luz\Desktop\nitgen\nitgen-bsp>python setup.py build
running build
running build_py
creating build
creating build\lib.win32-2.7
creating build\lib.win32-2.7\NitgenBSP
copying NitgenBSP\__init__.py -> build\lib.win32-2.7\NitgenBSP
running build_ext
building 'NitgenBSP/_bsp_core' extension
creating build\temp.win32-2.7
creating build\temp.win32-2.7\Release
creating build\temp.win32-2.7\Release\nitgenbsp
C:\MinGW\\bin\gcc.exe -mdll -O -Wall "-ID:\Program Files (x86)\NITGEN eNBSP\SDK\
inc" -IC:\Python27\include -IC:\Python27\PC -c NitgenBSP/bsp_core.c -o build\tem
p.win32-2.7\Release\nitgenbsp\bsp_core.o
In file included from D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI.h:4:0,

                 from NitgenBSP/bsp_core.c:3:
D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI_Basic.h:15:1: error: unknown
 type name 'BYTE'
 typedef BYTE      NBioAPI_UINT8;
 ^
D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI_Basic.h:16:1: error: unknown
 type name 'WORD'
 typedef WORD      NBioAPI_UINT16;
 ^
D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI_Basic.h:17:1: error: unknown
 type name 'DWORD'
 typedef DWORD     NBioAPI_UINT32;
 ^
D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI_Basic.h:20:1: error: unknown
 type name 'INT_PTR'
 typedef INT_PTR   NBioAPI_SINT;
 ^
D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI_Basic.h:21:1: error: unknown
 type name 'UINT_PTR'
 typedef UINT_PTR  NBioAPI_UINT;
 ^
D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI_Basic.h:24:1: error: unknown
 type name 'BOOL'
 typedef BOOL      NBioAPI_BOOL;
 ^
D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI_Basic.h:26:1: error: unknown
 type name 'CHAR'
 typedef CHAR      NBioAPI_CHAR;
 ^
D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI_Basic.h:27:1: error: unknown
 type name 'LPSTR'
 typedef LPSTR     NBioAPI_CHAR_PTR;
 ^
D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI_Basic.h:34:1: error: unknown
 type name 'HWND'
 typedef HWND            NBioAPI_HWND;
 ^
In file included from D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI.h:5:0,

                 from NitgenBSP/bsp_core.c:3:
D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI_Type.h:242:31: error: expect
ed ')' before '*' token
 typedef NBioAPI_RETURN (WINAPI* NBioAPI_WINDOW_CALLBACK_0)(NBioAPI_WINDOW_CALLB
ACK_PARAM_PTR_0, NBioAPI_VOID_PTR);
                               ^
D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI_Type.h:243:31: error: expect
ed ')' before '*' token
 typedef NBioAPI_RETURN (WINAPI* NBioAPI_WINDOW_CALLBACK_1)(NBioAPI_WINDOW_CALLB
ACK_PARAM_PTR_1, NBioAPI_VOID_PTR);
                               ^
D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI_Type.h:247:4: error: unknown
 type name 'NBioAPI_WINDOW_CALLBACK_0'
    NBioAPI_WINDOW_CALLBACK_0  CallBackFunction;
    ^
D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI_Type.h:253:4: error: unknown
 type name 'NBioAPI_WINDOW_CALLBACK_1'
    NBioAPI_WINDOW_CALLBACK_1  CallBackFunction;
    ^
In file included from NitgenBSP/bsp_core.c:3:0:
D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI.h:131:43: error: unknown typ
e name 'LPCTSTR'
                                           LPCTSTR szResPath);
                                           ^
D:\Program Files (x86)\NITGEN eNBSP\SDK\inc/NBioAPI.h:252:43: error: unknown typ
e name 'LPCTSTR'
                                           LPCTSTR szResPath);
                                           ^
NitgenBSP/bsp_core.c: In function 'bsp_capture':
NitgenBSP/bsp_core.c:80:52: warning: assignment makes integer from pointer witho
ut a cast [enabled by default]
     winOption.CaptureCallBackInfo.CallBackFunction = MyCaptureCallback;
                                                    ^
error: command 'gcc' failed with exit status 1

luzfcb avatar Aug 20 '14 19:08 luzfcb

Perhaps those unknown types (e.g. BYTE) are defined in a different header that is not #include'd ? Not sure... I never tested this on Windows and have no plans on doing so. You should try building some of their examples and see if they work on Windows, then go back on troubleshooting the Python module.

fiorix avatar Aug 20 '14 19:08 fiorix