- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a main C++ function and I also added a Fortran as a static lib to this C++ project according to Steve's suggestion.
C++:
void A_FUN(int *A);
void B_FUN(int *B);
int main()
{
int a=1;
int b=1;
A_FUN(&a);
B_FUN(&b);
}
The two fortran functions, A_FUN ,is in a file called Fortran_File1.f90, and B_FUN, in a file called Fortran_File2.f90
Fortran_File1.f90 contains :
subroutine A_FUN(A)
end rubroutine
Fortran_File2.f90 contains
subroutine B_FUN(B)
end robroutine
If I comment out either A_FUN or B_FUN in C++ main funtion and compiled the solution, everything works fine. However, if I compile the solution with A_FUN and B_FUN. The compiler gave me thelink error
"error LINK 2001: unresolved external symbol "void _cdecl _B_FUN(int*)" ?(_B_FUN@@YAXPEAH0@Z).
Thank you in advance!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page