Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create a simple project with external libraries 1

Status
Not open for further replies.

baharengineer

Programmer
Jul 9, 2010
42
IR
hi
i'm new in fortran and i can not run any program that has an external library (for example attached program)

i don't know what i must do for link a library to program

i work with Compaq Visual Fortran 6.6 .

how can i run programs with libraries? please help me step by step

or give me a simple sample in attachment...

thanks alot
 
I don't see the main program.

A subroutine is not enough to construct a code : you need a main program. This is not related to the language you use : a main program is needed as well in C or Java.

Code:
PROGRAM test
   ! declarations of variables
   ...
   ! call to routines, for instance yours in sample1.f
   CALL c_circ(...)
   ...
END PROGRAM

 
Under settings

Link Tab
Category Input, add the additional libraries
If the libraries are in a different path, add the paths in Additional library path

Click OK and build
 
thanks but whether i must put for example calcomp.lib path in additional library?

you see! for example i past library file in desktop and then can i give the path in additional library ? or i must put the library file in a special directory?
and whether i must write name of library after path or not? and whether i must write the name with ".lib" or not?

and as last question : if i rebuild the program , setting configuration will restore? and i have to build project only for fix the setting that i done?

thanks a lot
 
If you have calcomp.lib on your desktop

Add calcomp.lib as additional library (with the .lib)
Add the full path to your desktop as the additional directory

Once you have done that, save all. If you File/Exit instead of just clicking on the x, it should save it for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top