Forum Jump

Select Group :
Select Forum :
Sorted By :
Sort Order :
From The :
 
Thread Tools  Search this thread 
Silvia Cagnone
Total Points:
70
Status Points:
20
Green Belt
June 13, 2009 9:50 AM PDT
IVF 11.0.074 cannot link to external dll
Dear Forum,

I am having a problem with IVF 11.0.074 pro with IMSL (version with VS2005 included) under Win VISTA Business SP1.

Apparently, it is not possible to link against external dlls.
I have built a dll and a simple main program that calls it:

1. build the dll
ifort try.f90 -dll

2. build the main
ifort main.f90 try.lib

when I launch the main.exe i get the MVSCRT80.dll missing error.
If I put such dll into the working dir I get the following error:
Error R6034: an application has made an attempt to load the C runtime library incorrectly.

Notice the following.
1. I have run try.dll through dependency walker. There are dependencies upon other system's dll (IExplorer dlls as well!)
but if I put in such dlls I get the same error.
2. Of course, if I include the subroutines into the main everything is fine.
3. I have installed the following:
VS 2005 Premier partner edition SP1
VS 2005 SP1 Update for VISTA
MS SDK 6.1 for WIndows server 2008
MS Visual C++ 2008 redistributable kit

I looked at previous threads but could not find something relevant.
At this point I have no more clues, maybe I am missing something fundamental.
any help would be greatly appreciated.

Thank you

Silvia
Steve Lionel (Intel)
Total Points:
111,441
Status Points:
111,441
Black Belt
June 13, 2009 1:39 PM PDT
Rate
 
#1
You need the MSVC 2005 redistributable kit.  Remove the DLLs you added manually.



Silvia Cagnone
Total Points:
70
Status Points:
20
Green Belt
June 13, 2009 4:00 PM PDT
Rate
 
#2 Reply to #1
You need the MSVC 2005 redistributable kit.  Remove the DLLs you added manually.

Dear Steve,

thank you for your help,
I have installed both the MSVC 2005 and the 2008 redistributable kit SP1 but I get the same error.
Do I have to remove the MSVC 2008 kit first ?

Thank you

Silvia


Silvia Cagnone
Total Points:
70
Status Points:
20
Green Belt
June 13, 2009 4:41 PM PDT
Rate
 
#3 Reply to #1
You need the MSVC 2005 redistributable kit.  Remove the DLLs you added manually.

UPDATE:
if I build the dll through the windows IDE by setting a shared library project then I am able to link to such dll, even through the command line, that is:

ifort main.f90 try.lib
main.exe --> works

Now I need to understand which options are set through the IDE that are not with the command line,
needless to say that any help is much appreciated. Let me also say that I am a little bit disappointed with the time one has to spend to install and configure correctly the IVF.

Thank you
Silvia


Steve Lionel (Intel)
Total Points:
111,441
Status Points:
111,441
Black Belt
June 13, 2009 5:12 PM PDT
Rate
 
#4 Reply to #3
I haven't seen this kind of trouble before.  The IDE does run the Microsoft Manifest Tool to embed the manifest after the linker runs, but I haven't generally had a problem building from the command line.  I would suggest using /libs:dll when building the executable so that the EXE and DLL are using the same libraries.

You should not have to do ANYTHING when running on the same system you built on.



Silvia Cagnone
Total Points:
70
Status Points:
20
Green Belt
June 14, 2009 3:10 AM PDT
Rate
 
#5 Reply to #4
I haven't seen this kind of trouble before.  The IDE does run the Microsoft Manifest Tool to embed the manifest after the linker runs, but I haven't generally had a problem building from the command line.  I would suggest using /libs:dll when building the executable so that the EXE and DLL are using the same libraries.

You should not have to do ANYTHING when running on the same system you built on.

Dear Steve,

thank you very much, the inclusion of the switch -libs:dll does the job.

For the sake of completeness, my problem was not linking to a fortran dll from fortran itself but from R.
In order to link to a IVF dll from R I need to specify the -static option otherwise it gives the MSVCR80.dll/R6034 error

ifort try.f90 -dll -static

does the job for me.

Thanks again

Silvia







Intel Software Network Forums Statistics

8246 users have contributed to 31154 threads and 98783 posts to date.
In the past 24 hours, we have 45 new thread(s) 107 new posts(s), and 168 new user(s).

In the past 3 days, the most popular thread for everyone has been Winsock? The most posts were made to Winsock? The post with the most views is This is a question for IPP f

Please welcome our newest member jaschaw