- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got unresolved external symbol _MAIMPROG referenced in function _main.
I am using Intel Fortran v9 and Studio 2005.
I ran a very simple program C calling Fortran
and made the fort_lib depends on C project
so that the library is built first and then is linked into the C code.
C:
extern void MAINPROG();
int main()
{
MAINPROG();
return 0;
}
Fortran:
SUBROUTINE MAINPROG()
return
end
Actually, I convert it to a new solution from CVF VC++6.
I made the libraryusing "Extract CVF Project Items".
Thanks.
K Hong
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Converting a CVF project applies various options for CVF compatibility - two of these relate to calling conventions. Your code would not have worked with CVF without other options.
Right click on the project, select Properties, Fortran, External Procedures. Change the calling convention to "Default" (or "inherit from project defaults") and do the same for string length argument passing. Then rebuild.
Right click on the project, select Properties, Fortran, External Procedures. Change the calling convention to "Default" (or "inherit from project defaults") and do the same for string length argument passing. Then rebuild.

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