deploying Matlab C++ library to 64 bit

I am currently developing a C++ program to interact with a C++ shared library created with Matlab R2007a compiler. Somehow, I cannot pass the initialization stage. First I call mclInitializeApplication(NULL,0)) and this goes ok. But when I call let's say MyFunctionInitialize() it fails.
Previously this was working but now when I deployed the application on a 64 - bit machine, it does not work anymore. Could the 64 bit environment be a problem?
Alina Badau

Respuestas (3)

Friedrich
Friedrich el 14 de Jul. de 2011

0 votos

Hi,
is the target OS of the same type like the OS where the DLL is compiled on? What error do you get?
Alina Badau
Alina Badau el 14 de Jul. de 2011

0 votos

No, the DLL is compiled on a computer with OS: Windows XP and the taget machine has Windows server 2008 R2

7 comentarios

Friedrich
Friedrich el 14 de Jul. de 2011
You DLL is 32bit right? and the Win Server is 64bit? What error do you get? What do you mean with it fails?
Alina Badau
Alina Badau el 14 de Jul. de 2011
Yes, 32 bit and Win Server 64 bit. I don't get an error. It just returns with false from the initialization call.
if (!MyFunctionInitialize())
message= "could not initialize the library properly";
Friedrich
Friedrich el 14 de Jul. de 2011
For R2007a server 2008 wasn't a supported OS. Can you run the matrixdriver example from the ML doc? Maybe consider making a dependency walker profile and have a look why the initialisation step fails.
Alina Badau
Alina Badau el 14 de Jul. de 2011
I already run dependency walker on the shared library. It seems that everything is ok.
I will run the example and I will come back with an answer. Thank you!
Alina Badau
Alina Badau el 14 de Jul. de 2011
Can you give me a url for matrixdriver example? I can't find it..
Friedrich
Friedrich el 14 de Jul. de 2011
Dont run the dep walker on the shared lib. Compile everything into an EXE and then make a RUNTIME PROFILE of that exe. The right steps for this are:
i) choose File -> open and select your application
ii) choose Profile -> start profiling
iii) a window pops up
iv) press okay
v) your applications should start now
vi) after your application finished running investigate the log for hints what went wrong.
You can also:
vii) choose File -> save as
viii) upload the dwi file somewhere an post the link here
Alina Badau
Alina Badau el 14 de Jul. de 2011
I compiled everything into a console application, deployed it on the target machine and first, it said that MSVCR100D.dll is missing. After placing that into exe directory, the application worked. But.. in my C++ program it is a little bit different because it is all packed into a win32 dll, called by a ASP .NET web application. There still fails, even after placing into the path directory MSVCR100D.dll requested before.

Iniciar sesión para comentar.

Friedrich
Friedrich el 14 de Jul. de 2011

0 votos

Sounds like a missing redistributable package for Visual Studio 2010. Please install it on the target machine:
Copying DLLs from that package is not a good idea! Since you are running a 32bit application you need the 32bit redist. package.

14 comentarios

Alina Badau
Alina Badau el 14 de Jul. de 2011
I installed it, but I still have the same problem.
Friedrich
Friedrich el 14 de Jul. de 2011
Do you have the dep. walker profile for me so I can have a look?
Alina Badau
Alina Badau el 14 de Jul. de 2011
Can you provide an email address? i have the dwi from the exe.
Friedrich
Friedrich el 14 de Jul. de 2011
I created a temporary adress: friedrich@spaml.de
Alina Badau
Alina Badau el 14 de Jul. de 2011
I sent am email a few seconds ago.
Friedrich
Friedrich el 14 de Jul. de 2011
The attachment hasn't reached me. Please upload it to some filehoster and post the link to it. E.g.:
http://www.wupload.com/
Alina Badau
Alina Badau el 14 de Jul. de 2011
http://www.wupload.com/file/56861203/TestFunction.dwi
Friedrich
Friedrich el 14 de Jul. de 2011
This is about your test application which works fine, right? I can see that you still have the DLL copied near the exe. Does your test exe works when deleting the copied DLL's?
Alina Badau
Alina Badau el 14 de Jul. de 2011
No, it doesn't. Here is the dwi from the function without the dlls near the exe:
http://www.wupload.com/file/56872575/TestFunction.dwi
Friedrich
Friedrich el 14 de Jul. de 2011
Still the same. These DLLs are used
c:\inetpub\wwwroot\release\dropbox\dll output\MSVCR100D.DLL
c:\inetpub\wwwroot\release\dropbox\dll output\MSVCR80.DLL
Normally the entry should similar to:
c:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4940_none_d08cc06a442b34fc\MSVCR80.DLL
Please completly delete the copied DLLs from the system and do not move it into a different folder.
Alina Badau
Alina Badau el 14 de Jul. de 2011
Sorry, I completely deleted the dlls from the system. Now the app does not fire because "The program can't start because MSVCR100D.dll is missing from your computer.". The only dll the is used in dwi is LoanTapeCashFlow which is the shared library compiled with Matlab.
New upload link:
http://www.wupload.com/file/56878784/TestFunction.dwi
Friedrich
Friedrich el 14 de Jul. de 2011
So we are back to the actual issue. Missing DLLs on the system. Maybe I was wrong that the 32bit redist is needed. Please install the 64bit in addition:
http://www.microsoft.com/download/en/details.aspx?id=14632
Since the redist. packages provide the DLLs the error should vanish.
Alina Badau
Alina Badau el 14 de Jul. de 2011
I installed it. It is the same.
Friedrich
Friedrich el 14 de Jul. de 2011
It must be this issue. You can find some stuff in the internet talking about this missing DLL:
http://www.rhyous.com/2010/09/16/avoiding-the-msvcr100-dll-or-msvcr100d-dll/

Iniciar sesión para comentar.

Categorías

Más información sobre Introduction to Installation and Licensing en Centro de ayuda y File Exchange.

Preguntada:

el 14 de Jul. de 2011

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by