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

Linking .NET C++ and CVF v6.6 static library

jlea
Beginner
621 Views
I built a win32 static library (debug multi-threaded selected in the Libraries option) using CVF v6.6 with only fortran. I then used that library (Fort_lib.lib) as input to a .NET C++ project. The linker complains that it wants to find dformdd.lib. I thought that once I built Fort_lib.lib that I could use it in other C++ projects without having to worry about any additional fortran libraries, i.e., dformd.lib.

Thanks.

Jon.
0 Kudos
6 Replies
Steven_L_Intel1
Employee
621 Views
No - the .lib has outstanding external references. Add the DF98LIB folder to the list of library folders for the linker in the .NET IDE. Note that dformdd.lib is a multithreaded, debug library, so you need to use the same settings in C++.

Steve
0 Kudos
jlea
Beginner
621 Views
Thanks Steve for the clarification. After doing a little more research and several links, we had figured this was probably the case. So this means that if we want to build a fortran library using VS 6.0/CVF v6.6 and give to our .NET guys to link against in our multilanguage apps, we also need to give them dformdd.lib? Jon.
0 Kudos
Steven_L_Intel1
Employee
621 Views
Well..

First of all, none of the CVF libraries are redistributable, so if whomever you give your .LIB to doesn't already have the CVF libraries, you aren't allowed to give them the libraries. This is not peculiar to .NET issues - it's always been this way.

If you are distributing libraries, you're better off to do so as a release configuration and with the Libraries option set to link against the DLL form of the libraries (multithread DLL in your case). Whomever you give your code to will have to do the same, and you can distribute DFORMD.DLL

Steve
0 Kudos
jlea
Beginner
621 Views
Thanks again for the clarification - I think it is becoming clearer. Jon.
0 Kudos
jlea
Beginner
621 Views
Steve - sorry to be a pain... I built the fortran only .lib file in release mode using Multi-threaded DLL as the setting for Libraries on the Fortran tab. I then changed the .NET debug configuration to use this release version of the fortran .lib file. The .NET linker said it couldn't find DFORMD.LIB. I then changed the runtime setting for C++ code generation on the C++ folder (i.e., tab) to Multi-threaded DLL (from Multi-threaded Debug DLL) and got the same error messsage. Is it possible to build a debug .NET C++ configuration and linking in just the release version of the fortran .LIB file? Jon.
0 Kudos
Steven_L_Intel1
Employee
621 Views
By default, VC.NET has no idea where the CVF libraries are, so you would add the ..DF98LIB folder to the list of directories to be searched by the linker, or perhaps manually add the appropriate .LIB directly to your project.

Steve
0 Kudos
Reply