- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First, I apologize for asking a question that's probably aleady been answered by Steve a dozen times.I'm using IVF 8.0.1877.2003 and VS.net2003. I have a mixed FORTRAN and C language solution where I've put all the FORTRAN code into a project that builds a static library and the C code into a separate project that builds Win32 executable. The C code does all the GUI stuff, calls the FORTRAN code to crunch numbers, and the FORTRAN code passes some status info back to the C Code which displays the info in a status window. I have the build order of the projects set so that the FORTRAN builds first and then the C code. Here are the pertinent code chunks:
In the C header file
extern int __stdcall VORINP( int*, int*, int* );
In the C code
void HandleExecuteVorlax(...) {
int arg1, arg2, arg3;
...
dum = VORINP( &arg1, &arg2, &arg3)
...
}
In the FORTRAN code
INTEGER*4 FUNCTION vorinp( var1, var2, var3 )
INTEGER*4 var1 [REFERENCE]
INTEGER*4 var2 [REFERENCE]
INTEGER*4 var3 [REFERENCE]
...
vorinp = 1
return
When linking, I get the error
vorexecute.obj : error LNK2019: unresolved external symbol _VORINP@12 referenced in function _HandleExecuteVorlax
I originally coded this up using CVF 6.6 and VS 6.0, and everything worked fine. I then migrated to VS.net2003 and was able to make this work by building the FORTRAN as a static library and adding it as a resource to the C code project. Unfortunately, however, I'm stumped as to how to make this work with the IVF compiler.
Thanks in advance for any help!
Doug
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Take out the __stdcall in the C declaration of the Fortran routine. Intel Fortran does not use STDCALL as the default.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you also get errors that libraries are not found? You may need to add the paths to the IVF libraries to your Tools..Options..C++..Directories (I think - I'm not using a PC with the compiler installed right now.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, I do check in here off hours...
I can't tell from your description just what you have so far. Can you upload a zip file that has your .sln, .vcproj, .vfproj and .log files from the solution?
I can't tell from your description just what you have so far. Can you upload a zip file that has your .sln, .vcproj, .vfproj and .log files from the solution?
![](/skins/images/D3C0B914909A6564BBB97F4AD1ED1973/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page