wiki:AppLibraries

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

--

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.

The solution 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.