- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi everyone
I am not a programmer and a complete newbie to programming. I used to work with matlab but my friend wanted to create the same controller in fortran so that he could convert it into dll and use it in another software. with some help i created the fortran file. but now i have the problem while compiling.
I use ifort command to compile.
when i provide the command
ifort /dll externalcontroller.f90
it says link not found.
what am i supposed to do
I am not a programmer and a complete newbie to programming. I used to work with matlab but my friend wanted to create the same controller in fortran so that he could convert it into dll and use it in another software. with some help i created the fortran file. but now i have the problem while compiling.
I use ifort command to compile.
when i provide the command
ifort /dll externalcontroller.f90
it says link not found.
what am i supposed to do
Link Copied
8 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Do you have Microsoft Visual C++ 2003, 2005 or 2008 installed? Did you use the "Fortran Build Environment" shortcut under "Start > All Programs > Intel Software Development Tools > Intel Fortran Compiler" to open the command prompt window? What is the complete output of the command window starting with the beginning and through the attempt to build the DLL?
The command you show is the correct way, but something is wrong in your system configuration or the way you established the command environment.
The command you show is the correct way, but something is wrong in your system configuration or the way you established the command environment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i have microsoft visual c++ 2008 express edition installed. I did use the foltran build environment as you said .
the following ids what i got
C:F_Files>ifort externalcontroller.f90
Intel Visual Fortran Compiler for applications running on IA-64, Version 10.1
Build 20080312 Package ID: w_fc_p_10.1.021
Copyright 1985-2008 Intel Corporation. All rights reserved.
ifort: error #10037: could not find ' link'
C:F_Files>ifort /dll externalcontroller.f90
Intel Visual Fortran Compiler for applications running on IA-64, Version 10.1
Build 20080312 Package ID: w_fc_p_10.1.021
Copyright 1985-2008 Intel Corporation. All rights reserved.
ifort: error #10037: could not find ' link'
the following ids what i got
C:F_Files>ifort externalcontroller.f90
Intel
Build 20080312 Package ID: w_fc_p_10.1.021
Copyright
ifort: error #10037: could not find ' link'
C:F_Files>ifort /dll externalcontroller.f90
Intel
Build 20080312 Package ID: w_fc_p_10.1.021
Copyright
ifort: error #10037: could not find ' link'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you mean to install the Itanium (IA-64) compiler? Windows X64 is supported by 64-bit Windows for AMD64/Intel64 and the AMD64/X64 SDK option for VS and the Intel64 ifort.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To add to what Tim says, Visual C++ Express Edition supports building IA-32 (32-bit) applications only. You will need to install and use the IA-32 Fortrtan compiler.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Thank you for your advice.
I tried it and it created a DLL. but now i have another issue. Thee dll created by i fort causes an error in the program i am trying to use.
It says
Runtime error
R6034
An application has made an attempt to load the C runtime library incorrectly.
My fortran program for the dll is given below and i am trying to export DISCON as the dll file.
Thank you for your advice.
I tried it and it created a DLL. but now i have another issue. Thee dll created by i fort causes an error in the program i am trying to use.
It says
Runtime error
R6034
An application has made an attempt to load the C runtime library incorrectly.
My fortran program for the dll is given below and i am trying to export DISCON as the dll file.
! This is a very simple example of an external controller DLL written in FORTRAN which simply causes
! a step change in pitch position demand.
! If the pitch actuator cannot accept a pitch position demand, an error message is returned to Bladed.
! A simple example of logging output is also included.
SUBROUTINE DISCON (avrSWAP, aviFAIL, accINFILE, avcOUTNAME, avcMSG)
IMPLICIT NONE
!Compiler specific: Tell the complier that this routine is the entry point for the DLL
!The next line is for the case of the Digital Visual Fortran compiler
!DEC$ ATTRIBUTES DLLEXPORT, ALIAS:'DISCON' :: DISCON
!Arguments
REAL :: avrSWAP(*)
INTEGER :: aviFAIL
INTEGER*1 :: accINFILE(*), avcOUTNAME(*), avcMSG(*)
!Other declarations
INTEGER :: iStatus
INTEGER, SAVE :: iDone
REAL, SAVE :: rPitchDemand
CALL CHAR2INT(' ',avcMsg)
iStatus = NINT(avrSwap(1))
!Initialise
IF (iStatus .EQ. 0) THEN
!Initialise pitch demand to current pitch angle
rPitchDemand = avrSWAP(4)
!This is also where you could read in any user-defined data from accInFile
ENDIF
!Return demanded variables
!Note: previous values can be used before they updated, to simulate a one-sample delay
IF (NINT(avrSwap(10)) .EQ. 0) THEN
avrSWAP(42) = rPitchDemand
avrSWAP(43) = rPitchDemand
avrSWAP(44) = rPitchDemand
avrSWAP(45) = rPitchDemand
ELSE
CALL CHAR2INT('This simple DLL needs pitch position actuator',avcMsg)
aviFail = -1
ENDIF
!Main calculation
IF (aviFail >= 0) THEN
!Just a 1-degree step change in pitch position demand at 10 seconds
IF (iStatus .EQ. 0) iDone = 0
IF (avrSWAP(2) .GE. 10.0 .AND. iDone .EQ. 0) THEN
rPitchDemand = rPitchDemand + 0.017453
iDone = 1
ENDIF
!Logging output
CALL CHAR2INT('Pitch demand:A;',avcOUTNAME)
avrSWAP(NINT(avrSWAP(63))) = rPitchDemand
avrSWAP(65) = 1.0
ENDIF
RETURN
END
!==============================================================================================
!==============================================================================================
SUBROUTINE CHAR2INT(accString,avi1Int)
IMPLICIT NONE
CHARACTER*(*) accString
INTEGER*1 avi1Int(*)
INTEGER I
DO I = 1,LEN_TRIM(accString)
avi1Int(I) = ICHAR(accString(I:I))
ENDDO
avi1Int(LEN_TRIM(accString)+1) = 0
RETURN
END
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just saw the announcement of "the brand new Visual Studio Express Editions." It says clearly on the download web page C++ is for 32-bit native code only, as Steve said (unlike 2005 express). No wonder I had difficulty getting the earlier 2008 express to play with X64 SDK. Reminds me of Steve's favorite crack about my old home town.
As to the latest question, with 2005 Express, it was recommended to add the (32-bit) psdk to support making .dll. There are posts on microsoft forums suggesting that sdk components may have to be added to 2008 Express as well for this purpose.
As to the latest question, with 2005 Express, it was recommended to add the (32-bit) psdk to support making .dll. There are posts on microsoft forums suggesting that sdk components may have to be added to 2008 Express as well for this purpose.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
VC++ 2008 Express does not require a separate PSDK.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
kausi, how are you building this DLL (what options), and what type of program are you using it with?

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page