Changes between Version 5 and Version 6 of AppLibraries


Ignore:
Timestamp:
Sep 23, 2011, 9:32:56 AM (13 years ago)
Author:
davea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AppLibraries

    v5 v6  
    11= Dynamic library issues =
    22
    3 Applications can use dynamic libraries;
    4 just include them in the [UpdateVersions#multifile multi-file application].
     3Suppose your application uses a dynamic library, say '''vcomp90.dll'''.
     4Recall that [BoincFiles BOINC files are immutable].
     5Hence there is a problem if either
    56
    6 A problem arises if you support multiple platforms
    7 and the libraries for the different platforms have the same name.
    8 In BOINC, if files are called the same, they must be the same file.
     7 * You support multiple platforms (say, Win32 and Win64),
     8   and there are different versions of '''vcomp90.dll''' for each platform.
     9 * You need to update to new versions of the library.
    910
    10 For example, suppose you support both Win32 and Win64,
    11 and you use a DLL "vcomp90.dll" that has 32- and 64-bit versions.
    12 If you install the 32-bit app first,
    13 it will end up trying to link the 64-bit library, and will crash.
     11One solution is to give the libraries names that encode the
     12platform and version number,
     13e.g. '''vcomp90_win32_1_17.dll''' and '''vcomp90_win64_1_17.dll'''.
     14However, this may be infeasible
     15because the name '''vcomp90.dll''' is embedded in your Makefiles and
     16would be difficult to change.
    1417
    15 One solution is to give the libraries different names,
    16 e.g. '''vcomp90_32.dll''' and '''vcomp90_64.dll'''.
    17 However, this requires changing your application (or build system)
    18 to look for the DLL under that different name.
     18A second solution, which doesn't require changing Makefiles,
     19is to give the libraries different physical names but the same logical name.
     20To do this, use something like the following in your
     21[AppVersionNew#Theversiondescriptionfile version description file]:
     22{{{
     23...
     24  <file>
     25    <physical_name>vcomp90_win32_1_17.dll</physical_name>
     26    <logical_name>vcomp90.dll</logical_name>
     27    <copy_file/>
     28...
     29}}}
    1930
    20 A second solution, which doesn't require changing Makefiles or VS project files,
    21 is to give the libraries different physical names but the same logical name.
    22 Do this as follows:
    23 
    24  * 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.
    25 
    26  * Then, add another file called '''vcomp90.dll=vcomp90_v1.0_32bit.dll.file_ref_info''' containing just:
    27 {{{
    28 <copy_file/>
    29 }}}
    30 copy_file will ensure the file is '''copied to''' '''vcomp90.dll''', instead of linked,
    31 since Windows obviously won't understand BOINC soft links when trying to find
    32 the DLL.
    33 
    34 It's a good idea to add a version number to the physical name,
    35 in case you ever need to modify the file.
    36 This also means that even if you don't use multiple platforms,
    37 it's still useful to use this technique,
    38 using just a version number and no platform name.
     31The '''copy_file''' flag tells the BOINC to copy the library to
     32the application's runtime directory.