There are two options:


  • PixeLINK.lib
    • a static library
    • Your project will have all the required object files in the library statically linked into your project (exe)


  • PixeLINK.dll
    • dynamic link library (DLL)
    • your code will have a dependency upon PixeLINK.dll, and the installer for your software will have to include PixeLINK.dll


PixeLINK+.lib  - Static Library


1) Add $(PIXELINK_SDK_ROOT)\PixeLINK+ to your list of additional include directories


This is in addition to adding $(PIXELINK_SDK_ROOT)\include for the API header files

.

2) Add PixeLINK.lib and version.lib to the list of libraries to be linked into your project.


This is in addition to adding PxLApi40.lib


The DebugLib and ReleaseLib sub-directories under $(PIXELINK_SDK_ROOT)\PixeLINK+ have the debug and release static libraries, respectively.


3) Ensure you are compiling your code to use the appropriate multi-threaded dll C runtime library. If you don't, you will have linker issues (e.g. LNK2005: _fclose already defined in ...) because PixeLINK+ uses this library. If changing this in your project is going to cause you unending woe and grief, feel free to recompile PixeLINK+ using your favourite settings to generate a new static library suitable for your needs.


For example, if you're using Visual Studio, below you can see we've added (for all configurations of our application) the necessary dir to the "Additional Include Directories"



And this is what you see if you click on the ellipsis ("...") button when you give focus on the Additional Include Directories edit box



Moving on to the linker properties, we've added the appropriate directories to the Additional Library Directories field:


And examining these in detail, you can see what we added


The second entry takes advantage of the 'OutDir' project property (For debug builds it will be 'Debug', and release it will be 'Release') to point to the DebugLib or ReleaseLib dir, based on which configuration you're building. 


And finally, we add the three libraries.


1) PxLApi40.lib is the import library for the PxLApi40.dll (the exported functions are the PixeLINK API)


2) PixeLINK+.lib is the PixeLINK+ static library.


3) version.lib is required because PixeLINK+ currently depends upon it for some functions:



And finally, the code generation options.


For debug builds, we want to use the Multi-threaded debug dll runtime library



and for release builds, we want to use the multi-threaded dll runtime library. 



That's it!


Using PixeLINK+.dll


Using the PixeLINK+ dll is almost exactly the same as using the static library, with the following exceptions


1) Ensure your project defines PIXELINK_PLUS_DLL before including PixeLINK+.h


The preferable method to do this is to add PIXELINK_PLUS_DLL to the list of project preprocessor defines. e.g. 





2) Instead of using the static lib files in DebugLib and ReleaseLib, use the dll import libs in Debug and Release. 


Looking at the Additional Library Directories



That's it!