Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28445 Discussions

Compatibility Between Compiler Objects

Chyczewski__Tom
Beginner
377 Views
I have Microsoft Visual Studio 2010 with Intel Visual Fortran Composer XE 2011 (using Intel Fortran Compiler XE 12.1). I don't have C or C++ compilers.Apartner company hasprovided DLL's as well as an object file (compiled from a C++ source file) createdusing Microsoft VC++6 and Compaq Visual Fortran (for a few routines in the DLL's). I need to write a wrapper code in Fortran that links to the provided object file and is compatible with the provided DLL's it uses at runtime.

When I try to link my wrapper objects to the provided object I get an error saying that libci.lib couldn't be opened. If I direct the linker to ignore that library I get an error saying that LIBC.lib couldn't be opened. If I direct the linker to ignore that library it's as if the linker ignores the provided object file (I get a number of error messages saying that there are unresolved external symbols, these being defined in the provided object file). So, I presume I cannot ignore libci.lib or LIBC.lib. I am guessing that the linker can't find them because I don't have a C or C++ compiler. Does anyone know of a solution?

Also, are there any guarantee's that if I get my wrapper executable built, it will be compatible with the provided DLL's?

I didn't have any problems with this setup when I used Compaq Visual Fortran 6.6a. But, my operating system will soon be updated to Windows 7 and I have been told that Compaq Visual Fortran won't work under Windows 7.

Any help would be greatly appreciated.

Thanks,

Tom
0 Kudos
6 Replies
Steven_L_Intel1
Employee
377 Views
You have a couple of problems here. libc.lib was the static, non-thread-safe version of the Microsoft Visual C++ library. Microsoft stopped providing that as of VS2005. Unlike with the Compaq and Intel Fortran compilers. the Microsoft C++ compiler generates different code depending on which set of libraries are being used, so simply ignoring libc.lib isn't going to help you. libci.lib is another MSVC library no longer provided.

A second problem is that CVF-compiled objects are not link-compatible with those from Intel Visual Fortran.

You can install Compaq Visual Fortran on Windows 7, as long as you don't mind using it from the command line as the VS6 IDE does not work there. If you are installing on a 64-bit Windows 7, you'll need to run the setup.exe in the X86 subfolder of the install CD.

The ideal situation would be for the partner company to recompile the objects using a reasonably current MSVC (and Fortran). Then you wouldn't have these problems.

Can you explain more about these objects? What do they do?
0 Kudos
Chyczewski__Tom
Beginner
377 Views
Steve,

Thanks for your response, though it is not what I wanted to hear. I suspect what will happen is that I will end up using CVF in command line mode since that doesn't cost anything, though it is not ideal. I have askedmy partner tolook into upgrading his compiler but I'm not optimistic hehas budget to do so.

Here's some more explanation of my program:
I have been given DLL's built from a suite of propulsion routines. I wrote a code in Fortran that calls these routines to customize I/O and insert additional capabilities. Since I don't have a C++ compiler, I was also given a pre-compiled API Translate routine. As I understand it, it acts like an interface between the Fortran calls in my code and C++ routines in the DLL. I believe it also allows me to build my executable even though there are routines that aren't statically included in it (I don't have much experience with this aspect).

Thanks again for your response. It cleared things up for me.

Tom
0 Kudos
Chyczewski__Tom
Beginner
377 Views
Steve,

I'm afraid I am not out of the wood yet. From Compaq Visual Fortran I dumped out a Makefile. When I try to build the executable with NMAKE:

NMAKE /f "Makefile.mak"

I get an error while linking saying it couldn't open dfor.lib. The code compiles fine in the studio. Any suggestions? I searched my disc for dfor.lib but couldn't find it. I do have a DFORMD.DLL provided by my colleague.

Thanks.

Tom
0 Kudos
Steven_L_Intel1
Employee
377 Views
dfor.lib is provided by Compaq Visual Fortran. But if you have a reference to that, you cannot use Intel Visual Fortran to compile other Fortran sources. This is why I was suggesting you continue to use CVF for this part of the application until you can get the colleague to use a more current compiler. CVF hasn't been sold in eight years and MSVC6 is even older.
0 Kudos
Chyczewski__Tom
Beginner
377 Views
Sorry, I didn't explain my problem well. I'm preparing myself for the reality that I will probably be stuckusing CVF under Windows 7 and am trying to build my code outside of the studio (under Windows XP). I was getting the dfor.lib error while running NMAKE with the Makefile exported from the studio. I've since learned that CVF studio automatically sets up the proper environment (including required library paths). Adding a LIB environment variable with a value made up of paths to DF98\LIB and VC98\LIB takes care of my problem. Please let me know if you know of a better solution or if what I've done isn't foolproof. Thanks again for your help.

Tom
0 Kudos
Steven_L_Intel1
Employee
377 Views
I would be concerned about linking code compiled with Intel Fortran and CVF together, as there could be conflicts in the libraries. It might work under limited circumstances, depending on what the Fortran code did. Make sure you understand about STDCALL vs. C calling conventions, as the default differs between the two compilers.
0 Kudos
Reply