Steve Robinson writes:
> I have a fortran program and I compile OK with visual studio. Now I
> have an
> .obj file and .lib file which i want to link to my program obj file to
> prevent unresolved errors. How should I do this in visual studio?
The simplest way is to add the .obj and .lib file to the project as if
they were source files. An alternative is to name them under
"Additional Dependencies" in the Linker > Input property page (I am
assuming a VS 2002 or newer). If you do the latter, you will need to
specify the full path to the files.
If the object and library come from another Visual Studio project, you
can add that project to the VS "solution" and then use Project >
Dependencies to mark the library project as a dependent of the
executable project.
I will comment that the .obj and .lib file should have been compiled
with the same (or compatible) settings as the main program for the
run-time libraries to be used, otherwise you may get link errors.
If you are using Intel Visual Fortran or Compaq Visual Fortran, please
feel free to join and post in the Intel Visual Fortran for Windows user
forum at http://softwareforums.intel.com/ There you will find many
experienced and knowledgeable Visual Fortran users as well as a wealth
of information in previous topics you can search for.
Steve Lionel
Developer Products Division
Intel Corporation
Nashua, NH
|