Forum Jump

Select Group :
Select Forum :
Sorted By :
Sort Order :
From The :
 
Thread Tools  Search this thread 
sarma_amras
Total Points:
545
Status Points:
45
Brown Belt
December 3, 2008 9:47 PM PST
Connecting VC 2005 with Intel Fortran

Hi,

I would like to connect the VC 2005(Profession) with Intel Fortran(9.1) using the VC IDE.

May I please know how can I do this.

Regards

Kameswara Sarma

Steve Lionel (Intel)
Total Points:
112,121
Status Points:
112,121
Black Belt
December 4, 2008 5:18 AM PST
Rate
 
#1

It should work automatically after you install the compiler.  Open Visual Studio, click Help > About.  Click Copy Info and then paste the contents into a reply here.




sarma_amras
Total Points:
545
Status Points:
45
Brown Belt
December 4, 2008 8:40 PM PST
Rate
 
#2 Reply to #1

It should work automatically after you install the compiler.  Open Visual Studio, click Help > About.  Click Copy Info and then paste the contents into a reply here.

Steve this is the info abt the compiler

Microsoft Visual Studio 2005
Version 8.0.50727.42  (RTM.050727-4200)
Microsoft .NET Framework
Version 2.0.50727

Installed Edition: Professional

Microsoft Visual Basic 2005   77626-235-0521391-41820
Microsoft Visual Basic 2005

Microsoft Visual C# 2005   77626-235-0521391-41820
Microsoft Visual C# 2005

Microsoft Visual C++ 2005   77626-235-0521391-41820
Microsoft Visual C++ 2005

Microsoft Visual J# 2005   77626-235-0521391-41820
Microsoft Visual J# 2005

Microsoft Visual Web Developer 2005   77626-235-0521391-41820
Microsoft Visual Web Developer 2005

Crystal Reports    AAC60-G0CSA4B-V7000AY
Crystal Reports for Visual Studio 2005


Intel(R) Fortran Compiler Integration   
Intel(R) Fortran Compiler Integration for Microsoft Visual Studio 2005, Version 9.1.3427.2005, Copyright (C) 2002-2006 Intel Corporation

Fortran program:

 

program main

 

write(*,*)'Inside Fortran Function'

 

call c_fun

 

write(*,*)'Back to Fortran Function'

 

end

C program:

#include

<stdio.h>

void

c_fun()

{

printf(

"Inside C \n");

}

Error Message is :

error LNK2019: unresolved external symbol _c_fun referenced in function _MAIN__

Eagerly waiting for the solution and thanks in advance

Kameswara Sarma



Steve Lionel (Intel)
Total Points:
112,121
Status Points:
112,121
Black Belt
December 5, 2008 5:47 AM PST
Rate
 
|Best Answer
#3 Reply to #2

Sorry, I did not understand the question.  You want to build a mixed C and Fortran application.

  • First, please download and install Service Pack 1 for Visual Studio 2005.  This resolves a Microsoft bug relating to dependent projects.
  • The C code will need to be in a C++ Static Library project in your solution.  Once you have that, right click on the Fortran project and select the C project to be a dependent of the Fortran project
  • Make sure that the run-time library types match between C and Fortran.  In the C project, the property is under Code Generation, in Fortran, Libraries
  • I note that the Fortran program is looking for _c_fun.  That suggests to me that you compiled with the /names:lowercase option.  I don't recommend that - a better choice is to use !DEC$ ATTRIBUTES ALIAS to rename C_FUN or spell the C routine in upper case.

That should do it.  Since you are using an old version (11.0 is current), you don't have available the samples that were added in 10.0.  Those include mixed-language projects.






Intel Software Network Forums Statistics

8289 users have contributed to 31235 threads and 99109 posts to date.
In the past 24 hours, we have 7 new thread(s) 24 new posts(s), and 30 new user(s).

In the past 3 days, the most popular thread for everyone has been comparison cilk++, openmp, pthreads first results The most posts were made to comparison cilk++, openmp, pthreads first results The post with the most views is Very amusing...  Escalated as

Please welcome our newest member Michael Johanson