Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Makefile:
- # We're only here to build a DLL around the .LIB files that
- # Data Translation provides, since Python's ctypes library
- # can't work with .LIB. So, here we have a stupid little wrapper that
- # simply exports the parts of the .LIB that we need to be able to
- # work with.
- DTROOT = "C:\Program Files (x86)\Data Translation\Win32\SDK"
- DTINCLUDE = /I$(DTROOT)\Include
- DTLIBS = /LIBPATH:$(DTROOT)\Lib64 oldaapi64.lib OLMEM64.lib Graph64.lib
- CXXFLAGS = /MD /EHsc /DWIN32 /D_WINDOWS /DNOPCH /O2 $(DTINCLUDE)
- DTOBJS = dt_wrapper.obj
- DTTARGET = dt_wrapper.dll
- all: $(DTTARGET)
- $(DTTARGET): $(DTOBJS)
- link /dll /DEBUG /NOLOGO /out:$@ /SUBSYSTEM:WINDOWS $(DTOBJS) $(DTLIBS)
- clean:
- del *dll *lib *pdb *obj *exp
- Code:
- #include "stdio.h"
- __declspec(dllexport) int printer(void);
- int printer(void) {
- printf("Hello, world!\n");
- return 0;
- }
- Output:
- C:\mui\devices\resources\dataTranslationWrapper>nmake /f MAKEFILE
- Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
- Copyright (C) Microsoft Corporation. All rights reserved.
- cl /MD /EHsc /DWIN32 /D_WINDOWS /DNOPCH /O2 /I"C:\Program Files (x86)\Da
- ta Translation\Win32\SDK"\Include /c dt_wrapper.cxx
- Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
- Copyright (C) Microsoft Corporation. All rights reserved.
- dt_wrapper.cxx
- link /dll /DEBUG /NOLOGO /out:dt_wrapper.dll /SUBSYSTEM:WINDOWS dt_wrapp
- er.obj /LIBPATH:"C:\Program Files (x86)\Data Translation\Win32\SDK"\Lib64 oldaap
- i64.lib OLMEM64.lib Graph64.lib
- Creating library dt_wrapper.lib and object dt_wrapper.exp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement