- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have big scientific program written on fortran (using IMSL). It was developed in Compaq Visual Fortran 6.6. Now I would like to make it user-friendly, so user interface part will be written on c/c++. As far as I understood from previous posts, the correct way of developing such applications is to create 2 projects in one solution: first for fortran code and the second - for c/c++ code. Fortran code should be built into static library, which is used when linking c/c++ project.
My problem is the following. The fortran code is actually working application, furthermore Visual Studio 2005 reports no errors while building a library that contains functions and subroutines from my fortran project. Problems appear at the link stage of my c/c++ project.
Linker reports on unknown symbols and functions in my fortran library. Those functions are not called from c-project. Some of them are mine and used for internal calculations, others are IMSL subroutines or some variables, which are not mine.
Probably there is a standard way of building correct libraries. Can you help me?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1. In the Fortran library project, change the project property Libraries..Disable Default Library Search Rules from Yes to No.
2. In Tools..Options..Projects..VC++ Directories..Libraries, add the path to the Intel Fortran LIB folder (for example, C:Program FilesIntelCompilerFortran9.1IA32Lib) Also add the path to the IMSL LIB folder here.
3. Add the Fortran built .lib to the C++ project as a "source file". You can also add the path to it in the Linker property page as an "additional dependency".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Steve,
Does this imply that a CVF generated libraryis link compatible with VC++ 7/8 in VS 2003/2005, respectively?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ah, I missed that this was using CVF. In that case, replace my comment about the
"Intel" libraries with the CVF library directory. Other than that the advice is the same.
I see no reason why a CVF-built library should not be linkable with newer VC code, though I'd recommend building the CVF library with the "multithreaded" library option especially if you were going to use VS2005. But this is not something I am going to promise that it works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When you say user-friendly, what exactly do you mean?
It is quite possible to build a perfectly good GUI using menus, dialogs etcin Compaq Visual Fortran. Why did you balkat that solution?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I followed your instructions. It was also essential to change Multithreaded DLL option in c-project to Multithreaded.
I linked successfully my solution only when I listed all libraries from IMSL folder in the field of linked libraries in c-project.
So, finally I built my application. When Visual Studio 2005 starts my application it requires 3 dll-files. I found them in Intel Fortran directory and copied them into the directory where the executable file of my application reside. My next question is how to make those dll-s accessible from any folder at my computer and is it possible to buid my application the way it will not need those dll-libraries (to distribute it freely)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know about the possibility to create GUI in CVF. I have already created one for my old fortran program. But it seems more easy and more natural to me to write GUI-related code in C.
Fortran capabilities are ok if bare WinAPI is used, but for MFC it's better to use C++.
That's why I'm trying to use both fortran and c in one solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh, now I get it. The application was originally developed using CVF but you're using Intel Fortran now. Fine.
You can freely redistribute those Intel DLLs and putting them alongside your executable is the recommended practice. If you want to try static linking, change the libraries type for both the Fortran and C++ projects to "Multithreaded" (not Multithreaded DLL) and rebuild.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page