User's Manual - version: 0.3

15. Linking with KeyValue

The instructions in config/config.mak advise you to leave variables FELIBS_debug and FELIBS_release as they are in order to link KeyValue with the examples of core and bridge libraries. However, you must change these variables to point to your own core and bridge libraries' paths in order to link KeyValue with them. You can use either absolute or relative paths. Relative paths are taken from excel-addin and/or openoffice-addin directories.

If you are a Microsoft Visual Studio user, then you must use multi-threaded runtime libraries to compile your core and bridge libraries. More precisely you have two options depending on your build system:

Microsoft Visual Studio build system

Follow the instructions below if you use Microsoft Visual Studio build system to build your core and bridge libraries. (This is the default method choosen when you set up your libraries using Microsoft Visual Studio's IDE.)

  1. Open Microsoft Visual Studio and your solution file.

  2. Open the solution explorer (Ctrl+Alt+L).

  3. Right-click on you core library project.

  4. Select: Properties -> Configuration Properties -> C/C++ -> Code Generation.

  5. On the right panel on the properties page, select the correct Runtime Library depending on configuration as below:

    1. For Debug configuration choose "Multi-threaded debug (/MTd)";

    2. For Release configuration choose "Multi-threaded (/MT)".

    Remark: (a) and (b) above do not say to choose the "DLL" libraries.

    Figure 20. Choosing the right runtime libraries.

    Choosing the right runtime libraries.

Repeat steps (3) - (5) for your bridge library and for any other library you want to link with KeyValue.

Another build system

Follow the instruction below if you build your core and bridge libraries using another build system (e.g., makefiles, bjam, etc).

  1. Make sure you pass to MSVC compiler (cl.exe) the apropriate option regarding the runtime libraries:

    1. Use /MTd for debug build.

    2. Use /MT for release build.

If for some reason you are not happy to compile your libraries using the options above, then you can change KeyValues' compilation options. However, the LibreOffice add-in will not build anymore; only the Excel add-in will. To change KeyValue's compiling options open the file config/windows-msvc.mak in any text editor and edit the lines below

debug   : OBJ_FLAGS += -D_DEBUG -Od -Gm -RTC1 -MTd -ZI
release : OBJ_FLAGS += -DNDEBUG -O2 -Oi -GL -FD -MT -Gy -Zi

replacing the -MTd and -MT according to your preferences. You might need to rebuild KeyValue (clean and build again).

Valid HTML 4.01 TransitionalValid CSS!