- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
im relative new in fortran so i have one problem.
Im using "VS 2010" with "Intel(R) Visual Fortran Compiler XE 15.0.0.108 [IA-32]" compiler.
When i try to compile module like it say in book Numerical Recipes in Fortran 90:
"First, locate the important files nrtype.f90, nrutil.f90, and nr.f90, as
listed in Appendices C1, C1, and C2, respectively. These contain modules that either are (i) used by our routines, or else (ii) describe the calling conventions of our routines to (your) user programs. Compile each of these files, producing (with most compilers) a .mod file and a .o (or similarly named) file for each one."
it gives me error:
Error 1 error LNK2019: unresolved external symbol _MAIN__ referenced in function _main libifcoremdd.lib(for_main.obj)
Error 2 fatal error LNK1120: 1 unresolved externals Debug\recepti.exe
So i go to project properties - fortran - libraries and change Use intel math kernel libary to paralel (or any other) and after that i compile and it gives me new error:
Error 1 fatal error LNK1104: cannot open file 'mkl_intel_c_dll.lib' LINK
Files nrtype.f90, nrutil.f90, and nr.f90 can be found on http://www.nr.com/public-domain.html
So what am i doing wrong?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are trying to compile and link the files, when it was sufficient to compile. The module files will have been generated, so the failure of the link step can be ignored.
Make sure to place the module files in the expected place(s) so that the compiler will find them when you USE the modules in other projects later.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Module files in Fortran are similar to precompiled headers (header + code) in C/C++, or library .obj files. There use is similar:
YourMainProgram + Module/PreCompiledHeader.
As mecej4 was trying to say is you do not compile and run a module alone. Typically you compile it to produce an .mod file plus an .obj file (when the module also have contained subroutines and/or functions). Once the module is created (similar to pre-compiled header), it is linked with your MainProgram code. Also pay heed to mecej4's note about where you place the module files.
Jim Dempsey
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page