Hi,
I am trying to make use of a common directory that should avoid duplicating code, i.e. only make use of the USE <module_name>. The test program are as follows:
- conversions_mod.f95 and
- test_module.f95
- user environment variable: mod_path=h:\ftn95\user\modules
Compile and link message/error 😢
Compiling file: test_module.f95 H:\FTN95\test\test_module.F95(3) : warning 242 - Variable I has been given a value but never used Compilation completed with no errors. Linking... WARNING the following symbols are missing: CONVERSIONS_MOD!STR2INT H:\FTN95\test\CheckMate\Win32\test_module.obj (H:\FTN95\TEST\TEST_MODULE.F95) Creating executable: CheckMate\Win32\test_mod.exe Linking completed.
The test project only includes the test_module.f95 file while the .MOD and .OBJ files are in the directory defined by mod_path. Why do I get missing symbols if the mod_path is set?
I hope to solve this and for once begin to uderstand how to use libraries.
Regards Jacques
Here is the test code:
program test_module
use conversions_mod
integer :: i
i = str2int('230')
end program
module conversions_mod
implicit none
contains
INTEGER FUNCTION STR2INT(STR)
implicit none
character(len=*),intent(in) :: str
integer :: num
READ(str,*) NUM
STR2INT = NUM
return
end function str2int
end module