Skip to content

Building the library

Dan Parnham edited this page May 16, 2016 · 2 revisions

Installation

There are 64-bit packages available to download for Ubuntu and Windows. The Windows archives also include a build of the example application iconograph along with the relevant dependencies.

For all other platforms it must be built from source and manually installed.

Building

We use premake5 to generate files for make, but it can also be used to generate project files for a variety of IDEs such as CodeLite, Code::Blocks and Visual Studio. On Ubuntu it can be installed via apt-get, otherwise it should be downloaded and made available on the path.

Prerequisites

Linux

Install the libemergent library and then:

$ sudo apt-get install build-essential libusb-1.0-0-dev
$ premake5 gmake
$ make

Windows (mingw)

  • Install MinGW and make its "bin" folder available on the path.
  • Download the FreeImage Windows binary image.
    • Copy the header file to {path-to-mingw}/include.
    • Copy the dll to {path-to-mingw}/lib.
  • Download the libusb Windows binary image.
    • Copy the libusb-1.0 header directory to {path-to-mingw}/include.
    • Copy the appropriate MinGW dll to {path-to-mingw}/lib.
  • Download libemergent
    • Copy the emergent header directory to {path-to-mingw}/include.
> premake5 gmake
> mingw32-make

To build a 64-bit library you will need to install the appropriate version of MinGW and dependencies.

Windows (msvc)

  • Copy the FreeImage header to the include folder of libpsinc.
  • Copy the libusb-1.0 header directory to the include folder of libpsinc.
  • Copy the emergent header directory to the include folder of libpsinc.
> premake5 vs2013

The generated solution can then be opened in Visual Studio, updated to the latest version and then built.

Note: The msvc build will generate a static library since this avoids polluting the headers with __declspec(dllexport) and __declspec(dllimport).

To build a msvc project that uses libpsinc you must ensure that all of the headers described above can be found and the project must link against psinc.lib, FreeImage.lib and libusb-1.0.lib.

The premake script supports debug/release and x32/x64 configurations when generating visual studio solutions without affecting the standard linux build.

Clone this wiki locally