Re: My C++ extension does not work with LO4 anymore
On 10/31/2013 10:40 AM, Christophe Devalland wrote:
> The problem occurs on LO4 windows (installation or update of my
> extension with extension manager) :
> Runtime Error !
> c:\Program Files\LibreOffice 4\URE\bin\uno.exe
> An application has made an attenpt to load the C runtime library
> My extension for windows is compiled on MSVC2008. LO is compiled with
> MSVC 2010, isn't it ? I think that's the problem because it's OK with
> LO3 and Apache OpenOffice 4.
> How to fix that without recompiling my extension ?
> Here is my extension : http://cdeval.free.fr/spip.php?article132 > (translations available on the top right)
Short of recompiling your extension against the LO 4 baseline, another
option might be to tell users of your extension to first download and
install the old MS runtime libraries on their system (which are
available from MS, IIUC).
Short of recompiling your extension against the LO 4 baseline, another option might be to tell users of your extension to first download and install the old MS runtime libraries on their system (which are available from MS, IIUC).
IIRC with MSVC 2008 it is required that the DLL/EXE using the MSVCRT
DLLs needs to embed some crazy XML manifest, because the 2008 MSVCRT
DLLs are installed in some non-default location, not in the usual search
paths; this is different with MSVC 2010/2012 where the redistributatble
installs the DLLs into a default search path.
relevant bits in the LO build system are:
- passing "-manifestfile:mydll.manifest" to the link.exe so it writes
the manifest to the file
- "mt.exe $(MTFLAGS) -nologo -manifest mydll.manifest
-outputresource:mydll.dll\;2" to get the manifest file into the DLL
... and if you want to know why that is so ridiculously complicated (why
can't link.exe just put in the manifest into the DLL itself) you have to
use Microsoft. or speaking of that, why do applications need to bundle
the libc in the first place...
i hope with the above info it should be possible to get a DLL that loads
with the user installed 2008 redistributable. or you can rebuild it
with 2010 compiler.