- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have some issues using the IMSL ZANLY function with Fortran and Visual Studios 2019. I am trying to follow this example (https://help.imsl.com/fortran/6.0/math/default.htm?turl=zanly.htm) with my code below for your reference, and was given the following error LNK2019.
I have added the library directories for the IMSL functions in the project properties (following https://help.imsl.com/fortran/2021.0/common/readme.html#link-options under "USING FNL WITH VISUAL STUDIOS 2017". I also tried changing my LINKER > SYSTEM > SUBSYSTEM from console to windows but that doesn't work and generated an additional error saying " error LNK2019: unresolved external symbol WinMain referenced in function "int__cdeclinvoke_main(void)"(?invoke_main@@YAHXZ) ". Does any one have any suggestions to resolve this please?
program Console
USE ZANLY_INT
USE WRCRN_INT
implicit none
INTEGER :: INFO(3), NGUESS, NNEW
COMPLEX*16 :: F, Z(3), ZINIT(3)
EXTERNAL F
DATA ZINIT/3*(1.0,1.0)/
NNEW = 3
NGUESS = 3
CALL D_ZANLY (F, Z, NNEW=NNEW, NGUESS=NGUESS,ZINIT=ZINIT, INFO=INFO)
!CALL D_WRCRN ('The zeros are', Z)
end program Console
COMPLEX*16 FUNCTION F (Z)
COMPLEX*16 :: Z
F = Z**3 + 5.0*Z**2 + 9.0*Z + 45.0
RETURN
END
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to specify that the IMSL libraries are to be used at link time. I tried your example code with old versions of IMSL FNL (version 7) and IFort (2013 SP1), and the example built and worked fine. The build command that I used was
ifort /Qimsl xzanly.f90
If you are building in Visual Studio, see the documentation that came with your versions of IMSL, Intel Fortran and Visual Studio.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You need to specify that the IMSL libraries are to be used at link time. I tried your example code with old versions of IMSL FNL (version 7) and IFort (2013 SP1), and the example built and worked fine. The build command that I used was
ifort /Qimsl xzanly.f90
If you are building in Visual Studio, see the documentation that came with your versions of IMSL, Intel Fortran and Visual Studio.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply. You're right - on second look, I have missed out the following line in the code: include "link_fnl_shared_imsl.h". This has resolved the problem.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page