Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29274 討論

Building custom DLL for Ansys in win7 x64 with 0cx0000007b error

John_S_12
初學者
8,220 檢視

I need to build a custom external funciton  .DLL in fortran 90 format for Anysis:

It worked for xp 32 with compaq visual fortran. Now with the system migrated to 64bit, the Ansys is all new 64 system too.

Firt is that IT can not make the Visual Studio 2005 work for win7. So i tried to use intel visual fortran 10.0 intel(R) 64 command line ifort to build the dll file: it completes compilation without errors.

However when i start the main program there is a 0cx0000007b error. I understand it is a /32/64 bit issue. Can you provide a way to debug this?

Thanks.

0 積分
28 回應
Steven_L_Intel1
2,420 檢視
Are you doing the DependencyWalker on the system that has the problem? All of the web references I can find on this issue say that it is a missing or wrong version of the Microsoft VC DLLs. I am concerned that you have private copies of these DLLs (such as MSVCR80.DLL.) What happens if you temporarily rename that to something else? Try installing http://www.microsoft.com/en-us/download/details.aspx?id=18471 on the target system.
John_S_12
初學者
2,420 檢視
Steve Lionel (Intel) wrote:

Are you doing the DependencyWalker on the system that has the problem? All of the web references I can find on this issue say that it is a missing or wrong version of the Microsoft VC DLLs. I am concerned that you have private copies of these DLLs (such as MSVCR80.DLL.) What happens if you temporarily rename that to something else?

Try installing http://www.microsoft.com/en-us/download/details.aspx?id=18471 on the target system.

Yes all on the same computer. the DLLs indeed can be seen in a lot of locations on my machine! Looks like the machine has MSVC++ 2005 redistributable (X64) versions 8.0.56336 , 8.0.59192 and 8.0.61000 installed already
Johannes_Rieke
新貢獻者 III
2,420 檢視
Hi all! Sorry, that I'm asking all these newbie question, but I'm trying to learn for future task, where I will use Ansys custom builds also. Sorry John for using your thread for it. Why stick to MSVC++ 2005 redistributable (X64)? Ansys programmers manual explicitly says: Use VS2008 or .NET 3.5 SP1 SDK as alternative. cited from programmers manual v14: "Visual Studio 2008 is required for linking user programmable features on Windows platforms. However, if you do not have Visual Studio 2008, you can still link user programmable features into ANSYS by downloading Microsoft's .NET Framework 3.5 SP1 SDK from the following location: http://www.microsoft.com/downloads/details.aspx?familyid=C17BA869-9671-4330-A63E-1FD44E0E2505&displaylang=en After installing this SDK, you should be able to use any of the linking procedure described above. Before starting any of the linking procedures, make sure you open the Windows SDK CMD shell by picking Start > All Programs >Microsoft Windows SDK v7.0 > CMD Shell." If you link from this .net 3.5 sdk CMD shell, aren't the environmental variables are set to the correct DLLs? But if I use the .net CMD shell and not the ifort CMD shell, how can I be sure that the correct intel fortran runtime DLLs are used. Can't you use ifort from a normal CMD shell? In the attachment I put a comparision of the path environment from different shell types. The Visual studio x64 CMD shell contains also the intel redist x64 path, but mpirt e.g. in the VS CMD shell points to 32bit version?? Kind regards, Johannes
John_S_12
初學者
2,420 檢視
Steve, Another problem with my VS2005 is that when i try to open the previous Compaq Visual Fortran project xxxx.dsw. The ms VS says: "The project file 'xxxx.dsp' has been corrupted and cannot be opened. " does this error message somewhat correlate with the above DLL build problem?
Steven_L_Intel1
2,420 檢視
I can't think of any possible correlation. I have seen occasional reports from customers of this error, but when they send me the CVF project it always converts fine for me, so I don't know what the issue is there. The only exception is that if you don't have Visual C++ (as you would not if you are using the VS Shell), then CVF project conversion is not available.
John_S_12
初學者
2,420 檢視
I finally got the relevant personal in Ansys to help me: They told me the user defined .DLL needs to be in 32bit format. The error is still there though when i use ia-32 compiler: check the DLLs with dwalker for the Dll file I built: user_force.dll VS. dll file comes with the system that works: user_force_v12.dll: The lib msvcr80.dll for the working user function is from the folder c:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_d09154e044272b9a\MSVCR80.DLL. I have to copy this file to the project folder without being able to include this into the visual fortran search path...
John_S_12
初學者
2,420 檢視
updates: it's working! First the user defined DLL needs to be 32bit%*(%^((. Then use vs2005 work with IVF to generate a release version of userFile.DLL which automatically pick the MSVCR80.DLL in the following directory: c:\windows\winsxs\x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_d09154e044272b9a\MSVCR80.DLL For some must be simple reason i could not make the vs2005 to build anything in the /release or /debug folder except the log file BuildLog.htm (any one?); I thought using command line compiler would be neat for this small code apparently I was wrong!@ Thanks for all your helps!
B_M_
初學者
2,420 檢視

Hi John,

 

I having exactly same problem as you did. Could you kindly explain me how to buid the .dll file . I have tried to follow your last post but could not get it work. I have visual sutdio 2012 and intel visual fortran composer , the latest versions.

the dlls I checked through 'dependency walker' shows that the file that I generate is not linking to MSVCRT90.dll.

 

Thanks in advance.

回覆