000022864 - How to build a DLL that uses RSA BSAFE with nmake and Visual Studio 2005 and 2008

Document created by RSA Customer Support Employee on Jun 16, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000022864
Applies ToBSAFE
Microsoft Windows
Microsoft Visual Studio 2005
Microsoft Visual Studio 2008
IssueHow to build a DLL that uses RSA BSAFE with nmake and Visual Studio 2005 and 2008
Application crashes when Crypto-C ME library is called from within a DLL built using a modified sample makefile

This application has failed to start because MSVCR80.dll was not found. Re-installing the application may fix this problem.

Resolution

Make sure that your makefile includes the /DLL option.  This is an option that CL passes to LINK and is described here:

http://msdn.microsoft.com/en-us/library/y0zzbyt4(VS.71).aspx

For example, to builld a modified Crypto-C ME r_dgst.c sample as a DLL, add the following r_dgst.dll target to the sample makefile:

r_dgst.obj: r_dgst.c
 $(CC) /For_dgst.obj $(SAMPLE_CFLAGS)  -c r_dgst.c

r_dgst.exe: r_dgst.obj $(APP_EX_OBJ)
 $(LINK) $(LFLAGS) /out:r_dgst.exe @<<
  $(APP_EX_OBJ) r_dgst.obj $(L_LIBS) $(EX_LIBS)
<<

r_dgst.dll: r_dgst.obj $(APP_EX_OBJ)
 $(LINK) /DLL $(LFLAGS) /out:r_dgst.dll @<<
  $(APP_EX_OBJ) r_dgst.obj $(L_LIBS) $(EX_LIBS)
<<

Notes

Any DLL that you wish to use with an application built with MS Visual Studio 2005 + must have an embedded manifest.

How to embed the manifest is described at: http://msdn.microsoft.com/en-us/library/ms235591(VS.80).aspx

If you've already generated the DLL and manifest file, you can embed the manifest like this:

mt.exe ?manifest MyLibrary.dll.manifest -outputresource:MyLibrary.dll;2

Legacy Article IDa39828

Attachments

    Outcomes