Documentation Buy Contact Blog


If you have any trouble, be sure to check the examples. As they come with working projects / makefiles.


Once you have extracted the zip somewhere, you are ready to setup Microsoft Visual C++ to build your codes with number duck. Right click on your project and go to Properties, from this dialog you can set your project to build with number duck.

Under C++, add the Include folder to Additional Include Directories. This can be a relative or absolute path.

Under Linker -> Input, add NumberDuck.lib to Additional Dependencies. Making sure you have the correct one based on if your project is 32bit or 64bit.

Now add NumberDuck.dll to your project folder. Again making sure you have the correct 32bit or 64bit one.

Now check out the simple example or the examples inside the .zip file to get started reading and writing Excel files.


Building on Linux should be pretty straightforward. Make sure the Include directory is set and that you link to the Number Duck dynamic library.

g++ -o FullExample -I../../Include -L../../Bin64 -Wl,-rpath,../../Bin64 -lNumberDuck FullExample.cpp
The weird "-Wl,-rpath,../../Bin64" bit adds the Bin64 directory to the library path, so you don't need to copy anywhere special to run your executable.


To use Number Duck from PHP, you just need to find the correct compiled library for your setup, put it in the correct place and edit the php.ini to enable it.

The compiled library you need for PHP is in either the Bin32 or Bin64 folder. Hopefully you can work out if you are running 32bit or 64bit, the prebuilt Windows builds on the PHP website are all 32bit. The libraries are named like this: php_numberduck_nts_50324.

The first part is if the build is thread safe or not. All Linux builds are nts. On Windows, you can run this command, you will probably need to be in the PHP directory or otherwise give the path to php.exe:

php -i | findstr -i "thread"
In the output you should see something like "Thread Safety => enabled".

To find the version, make another call to PHP. This command works on Linux or Windows:

php -v
Hopefully you get something like 5.3.x or 5.4.x. For 5.4 use libraries with the 050414 postfix, 5.3 builds use 050324.

Now you need to place this library in the correct place. On windows this should be the ext folder under your PHP folder. You can find the correct directory with this command:

php-config --extension-dir

Once you've put the library in the right place, you need to alter the php.ini to enable it. Add the following line to the "Dynamic Extensions" section, substituting the correct file name:

Note that it is .dll on windows and .so on Linux. On windows, you may also need to set the extension directory, if it is not already set:
extension_dir = "ext"

Now everything should all work and you can now use Number Duck to do awesome spreadsheety things. For more detailed instructions, check the official PHP page on Windows extensions. Check out the simple example or the examples inside the .zip file to get started reading and writing Excel files.

Command Line

When using PHP in CLI mode, for running our examples or somesuch, it is also possible to load an extension as a command line argument.

php "-dextension=php_numberduck_ts_50414.dll" CellColorExample.php
Note that the library must be in the default extension directory for this to work, or you can just give the full path. Also if the extension is already specified in php.ini specifying it here will attempt to load it twice and give you an error.