Software
C/C++ Driver Interface
(c) Spectrum GmbH
41
Microsoft Visual C++ 64 Bit
Depending on your version of the Visual Studio suite it may be necessary to install some additional 64 bit components (SDK) on your system.
Please follow the instructions found on the MSDN for further information.
Include Driver
The driver files can be directly included in Microsoft C++ by simply using the library file spcm_win64_msvcpp.lib that is delivered together
with the drivers. The library file can be found on the CD in the path /examples/c_cpp/c_header. All functions described below are now
available in your program.
Borland C++ Builder 32 Bit
Include Driver
The driver files can be easily included in Borland C++ Builder by simply using the library file spcm_win32_bcppb.lib that is delivered together
with the drivers. The library file can be found on the CD in the path /examples/c_cpp/c_header. Please include the library file in your Borland
C++ Builder project as shown in the examples. All functions described below are now available in your program.
Examples
The Borland C++ Builder examples share the sources with the Visual C++ examples. Please see above chapter for a more detailed documen-
tation of the examples. In each example directory are project files for Visual C++ as well as Borland C++ Builder.
Linux Gnu C/C++ 32/64 Bit
Include Driver
The interface of the linux drivers does not differ from the windows interface. Please include the spcm_linux.lib library in your makefile to have
access to all driver functions. A makefile may look like this:
Examples
The Gnu C/C++ examples share the source with the Visual C++ examples. Please see above chapter for a more detailed documentation of
the examples. Each example directory contains a makefile for the Gnu C/C++ examples.
C++ for .NET
Please see the next chapter for more details on the .NET inclusion.
Other Windows C/C++ compilers 32 Bit
Include Driver
To access the driver, the driver functions must be loaded from the 32 bit driver dll. Most compilers offer special tools to generate a matching
library (e.g. Borland offers the implib tool that generates a matching library out of the windows driver dll). If such a tool is available it is
recommended to use it. Otherwise the driver functions need to loaded from the dll using standard Windows functions. There is one example
in the example directory /examples/c_cpp/dll_loading that shows the process.
Example of function loading:
Other Windows C/C++ compilers 64 Bit
Include Driver
To access the driver, the driver functions must be loaded from 64 bit the driver dll. Most compiler offer special tools to generate a matching
library (e.g. Borland offers the implib tool that generates a matching library out of the windows driver dll). If such a tool is available it is
COMPILER = gcc
EXECUTABLE = test_prg
LIBS = -lspcm_linux
OBJECTS = test.o\
test2.o
all: $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(COMPILER) $(CFLAGS) -o $(EXECUTABLE) $(LIBS) $(OBJECTS)
%.o: %.cpp
$(COMPILER) $(CFLAGS) -o $*.o -c $*.cpp
hDLL = LoadLibrary ("spcm_win32.dll"); // Load the 32 bit version of the Spcm driver
pfn_spcm_hOpen = (SPCM_HOPEN*) GetProcAddress (hDLL, "_spcm_hOpen@4");
pfn_spcm_vClose = (SPCM_VCLOSE*) GetProcAddress (hDLL, "_spcm_vClose@4");