- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am using Visual Studio 2005 to build a solution in which I am mixing a c project (main program) and a FORTRAN project (static library). I made c calling fortran subroutine compiled successfully by reading some of the threads in this forum. However, the linker still gave me problems because I am calling some quickwin functions within the FORTRAN subroutine. If I compile the fortran codes as a stand-alone project, it works. Here is a simplified version of my projects:
in C
In FORTRAN
subroutine CE() BIND(C, NAME="CE")
xxxxxxxxxxxxxxxx ! declarations
end subroutine
When I build the solution, it gave me an error like
Error 1 error LNK2019: unresolved external symbol __f_setwindowconfig referenced in function _CE ce.lib
I am using IVF 12.X. I added the fortran library path in VS2005. I alsoMade my C program depending on FORTRAN. I don't know how to fix this error. Can anybody help? Thanks in advance!
Yong
I am using Visual Studio 2005 to build a solution in which I am mixing a c project (main program) and a FORTRAN project (static library). I made c calling fortran subroutine compiled successfully by reading some of the threads in this forum. However, the linker still gave me problems because I am calling some quickwin functions within the FORTRAN subroutine. If I compile the fortran codes as a stand-alone project, it works. Here is a simplified version of my projects:
in C
#include
#include
extern void CE();
int main (int argc, char **argv)
{
CE();
}
In FORTRAN
subroutine CE() BIND(C, NAME="CE")
xxxxxxxxxxxxxxxx ! declarations
res = SETWINDOWCONFIG(wcMain)
end subroutine
When I build the solution, it gave me an error like
Error 1 error LNK2019: unresolved external symbol __f_setwindowconfig referenced in function _CE ce.lib
I am using IVF 12.X. I added the fortran library path in VS2005. I alsoMade my C program depending on FORTRAN. I don't know how to fix this error. Can anybody help? Thanks in advance!
Yong
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you specify that ifqwin.lib should be included in the link step, either directly or through compiler options/directives?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I actually used
use msfwin
in my FORTRAN code
How do I specify that this libraray should be included in the link step?
use msfwin
in my FORTRAN code
How do I specify that this libraray should be included in the link step?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
MSFWIN is for Win32 API routines, not QuickWin, and it would be better to use IFWIN or perhaps the individual modules for the Win32 libraries.
First, you need to follow the steps here to configure Visual C++ for mixed-language applications. Then you need to change the Fortran project property Libraries > Use Runtime Library to "QuickWin" and Disable Default Library Search Rules to "No". Then rebuild both projecs.
First, you need to follow the steps here to configure Visual C++ for mixed-language applications. Then you need to change the Fortran project property Libraries > Use Runtime Library to "QuickWin" and Disable Default Library Search Rules to "No". Then rebuild both projecs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, steve. I actually used both Win32 API and QuickWin functions. Since the original stand-alone FORTRAN project used quickwin project type to begin with, we did not have to "use" it in the code. I did what you told me to do and it worked like a charm! Thanks a billion! I will have to test my application to make sure it is working as it supposed to be now.
Thanks again!

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