Boost logo

Boost-Build :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2005-11-17 17:45:47


I have a project that contains a DLL which only has resources inside it
(i.e. no exported symbols). There are a few issues:

1. Using the install rule generates the following error:

common.copy ..\..\..\bin\speaker\speak-en.dll
         1 file(s) copied.
msvc.link.dll
..\..\..\build\tools\speaker\res\msvc-7.1\release\character-set-wide\speak-en.dll
..\..\..\build\tools\speaker\res\msvc-7.1\release\character-set-wide\speak-en.lib
common.copy ..\..\..\bin\speaker\speak-en.lib
The system cannot find the file specified.

     copy
"..\..\..\build\tools\speaker\res\msvc-7.1\release\character-set-wide\speak-en.lib"
"..\..\..\bin\speaker\speak-en.lib"

...failed common.copy ..\..\..\bin\speaker\speak-en.lib...

2. I need to add a C++ file which contains an empty DllMain function:

-- resource.cpp

#include <windows.h>

BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void * )
{
    return TRUE;
}

-- Jamfile

lib speak-res
   :
     resource.cpp speak.rc
   :
     <link>shared
   ;

-----

The msvc compiler supports the /noentry flag for resource only DLLs,
therefore we should have:

-- builtin.jam

feature resource-only : no yes : incidental ;

-- msvc.jam

flags msvc.link LINKFLAGS <link>shared/<resource-only>yes : -noentry ;

- Reece


Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk