wiki:AppLibraries

Version 2 (modified by davea, 15 years ago) (diff)

--

Dynamic library issues

Applications can use dynamic libraries; just include them in the multi-file application.

A problem arises if you support multiple platforms and the libraries for the different platforms have the same name. In BOINC, if files are called the same, they must be the same file.

For example, suppose you support both Win32 and Win64, and you use a DLL "vcomp90.dll" that has 32- and 64-bit versions. If you install the 32-bit app first, it will end up trying to link the 64-bit library, and will crash.

One solution is to give the libraries different names, e.g. vcomp90_32.dll and vcomp90_64.dll. This requires changing your Makefiles or VS project files accordingly.

A second solution, which doesn't require changing Makefiles or VS project files, is to give the libraries different physical names but the same logical name. Do this as follows:

  • In the 32-bit app, call the file vcomp90.dll=vcomp90_v1.0_32bit.dll. This will be copied as "vcomp90_v1.0_32bit.dll" to the download directory, and used as "vcomp90.dll" on the client.
  • Then, add another file called vcomp90.dll=vcomp90_v1.0_32bit.dll.file_ref_info containing just:
    <copy_file/>
    

This will ensure the file is *copied* to vcomp90.dll, instead of linked, since Windows obviously won't understand BOINC soft links when trying to find the DLL.