Software Archive
Read-only legacy content
17061 Discussions

linking fortran subroutines to Visual C++

Intel_C_Intel
Employee
561 Views
I read in your faq's an example of creating a Win32 console app, written in standard C, and linking fortran subroutines into it. I have successfully done this. My problem is, I need to link fortran subroutines into multithreaded, multiwindow, RichEdit C++ app. At this, I have repeated failed. I keep getting errors like:

testView.obj : error LNK2001: unresolved external symbol "void __cdecl foobar(void)" (?foobar@@YAXXZ)

I have tried everthing I can think of. I have even created a C wrapper, used 'extern "C"' on it, and called the fortran from it, as one of your faq responses suggests. That is what I did to get the error listed above. I just can't make it work. I am frustrated and at wits end. Any thoughts out there?

Bill Tangren
0 Kudos
1 Reply
Steven_L_Intel1
Employee
561 Views
If you got that error, you didn't use 'extern "C"

I note you're still using 6.0, which means you don't have the very nice C_CALLS_F sample we provided in 6.5. Given that, try this example and work from there. You don't have to use a DLL, as is mentioned in the text.

You may also want to look at the updated Programmer's Guide chapter on mixed-language programming. And last, now is a good time to upgrade to 6.6 - a special low upgrade price is in effect until November 30. See our web site for details.

Steve
0 Kudos
Reply