Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29261 토론

error LNK2001: unresolved external symbol

Mike896
초급자
21,266 조회수

Hi

I convert one CVF's project to IVF's project.

Then I found some error linking showing:

***.obj : error LNK2001: unresolved external symbol _SYSTEM@8

or error LNK2001: unresolved external symbol _IERRNO@0

These ***.obj are all for module files.

I use some IMSL functions and I have set the "library" and "include". There are no errors relating IMSL libraries.

Thank you in advance.

MikeLiu

0 포인트
60 응답
sinereh_a_
초급자
3,402 조회수

but still I like to search the verison of my IMSL. So I used the same trick about the verlm subroutine code you provided me (I deleted the line "EXTERNAL UMACH, VERML" and added "USE IMSL"). but still I receive the following error:

Error: The attributes of this name conflict with those made accessible by a USE statement.   [VERML].

 thats because in line :"CHARACTER STRING(4)*50, TEMP*132, VERML*132 " I have again "VERML". I tried to add library using the two ways you suggested (adding IMSL.lib to project setting and using the CFV command window). the first did not show any changes in occured erros. and using the second way I received the following error:

verml.f90

f90:severe: no such file or directory  

the file is "VERLM.f90"

do you have any oppinion about these problems?

 

 

 

0 포인트
mecej4
명예로운 기여자 III
3,402 조회수

If you use USE IMSL..., you have to remove ", VERML*132" from the type declaration statement. Any "trick" or workaround is likely to be context dependent. If you change the context by adding a USE statement, the compiler will do its job and flag the newly redundant type declarations as errors.

0 포인트
sinereh_a_
초급자
3,402 조회수

 I removed ", VERML*132" from the type declaration statement. but I received the attached error after executing the program.

0 포인트
mecej4
명예로운 기여자 III
3,402 조회수

That variable (IMSLNT_F90) should have been set if you did your work in a CVF "Fortran Command Prompt". It should be set to the full path of the IMSL directory, which is under the DF98 directory. 

0 포인트
sinereh_a_
초급자
3,402 조회수

Thanks alot. I found DF98 directory but IMSLNT_F90 was not in that folder. How can I add it in that folder?

0 포인트
mecej4
명예로운 기여자 III
3,402 조회수

sinereh a. wrote:

Thanks alot. I found DF98 directory but IMSLNT_F90 was not in that folder. How can I add it in that folder?

You misunderstand what needs to be done. You may need to read Windows/DOS documentation to learn about environmental variables.

If, for example, the DF98 directory has the full path C:\Program Files\Microsoft Visual Studio\DF98, you need to set the environmental variable IMSLNT_F90 to C:\Program Files\Microsoft Visual Studio\DF98\IMSL, either using the SET command in the command window, or using the System Properties->Advanced->Environmental Variables control panel (the specific panel varies slightly with the version of Windows).

0 포인트
sinereh_a_
초급자
3,402 조회수

thanks so much.

I have a line in my code:

WRITE (NOUT,9) OBJ, (XSOL(I),I=1,NVAR)

9 FORMAT (//, ’ Objective = ’, F9.4, //, ’ Primal Solution =’, 8F9.4)

which causes the following errors. I don't know why all of these errors occur. could you please help me with solving them?

 

Compiling Fortran...

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: Unrecognized token '#18' skipped 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) --------------^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: Unrecognized token '#18' skipped 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ----------------------------^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: Unrecognized token '#18' skipped 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) -----------------------------------------^ C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: Unrecognized token '#18' skipped 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ------------------------------------------------------------^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: A constant or general expression must appear in a format list in this context.   [Objective] 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ----------------^ C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   [=] 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: The scale factor in the format list is either missing or invalid.   [PrimalSolution] 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) -------------------------------------------^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\LPTEST3.f90(17) : Error: This character is not valid in a format list.   [=] 9 FORMAT (//, . Objective = ., F9.4, //, . Primal Solution =., 8F9.4) ^ Error

executing df.exe.

0 포인트
mecej4
명예로운 기여자 III
3,402 조회수

Please attach the source file LPTEST3.f90, or include it inline surrounded by Fortran language highlighting bracket tags. Merely quoting lines is not useful because embedded tabs, punctuation characters and other control characters in the source file seem to be causing the problem.

0 포인트
andrew_4619
명예로운 기여자 III
3,402 조회수

In the fortran you show there are quote marks around  'Objective =' which is correct in the error message it shows .Objective =.

 

0 포인트
andrew_4619
명예로운 기여자 III
3,402 조회수

[fortran]9 FORMAT (//, ’ Objective = ’, F9.4, //, ’ Primal Solution =’, 8F9.4)

9 FORMAT (//, ' Objective = ', F9.4, //, ' Primal Solution =', 8F9.4)
9 FORMAT (//, " Objective = ", F9.4, //, " Primal Solution =", 8F9.4)[/fortran]

This top line is cut from your post, the character is not a quote character, not sure what it is it is not on my UK keyboard, either of the lower two lines will work.

0 포인트
sinereh_a_
초급자
3,402 조회수

Thanks so much. The problem is solved now by correcting the quote characters.

0 포인트
mecej4
명예로운 기여자 III
3,402 조회수

The program runs normally (from the Fortran point of view -- the exit code is zero).  If you run the program from a command window, you will see that the sixth call to DLPRS (on Line 114)  fails, with this error message:

[bash]

*** FATAL ERROR 2 from DLPRS. Maximum number of iterations exceeded.[/bash]

This failure has to do with whether the particular LP problem in this call is incorrectly defined or the algorithm fails. You may need to consult someone who is a LP specialist.

0 포인트
sinereh_a_
초급자
3,402 조회수

Yes thats right. This problem has results according to other linear programming methods (such as GAMS). But the fortran fails to give the results due to the maximum number of iterations exceed. now the issue is that I have to use Fortran for solving this problem because I have to link this LP model to another fortran model of mine. Do you have any opinion about how I can solve this LP with Fortran? or how I can change the maximum number of iterations allowed?

0 포인트
sinereh_a_
초급자
3,402 조회수

I even tried to solve my LP with another function of IMSL library but it gave me the similar error. I have attached that code too. If you can help me solve this error that would be fine too.

Thanks a lot.

0 포인트
sinereh_a_
초급자
3,402 조회수

.

0 포인트
sinereh_a_
초급자
3,402 조회수

My code is almost done. but there is still an error that I can not understand why it rises up! I have attached the code. could you please have a look at it?

the error is as below:

Loaded 'ntdll.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found. The thread 0x714 has exited with code 0 (0x0). The program 'C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Debug\Bargaining_LP_check.exe' has exited with code 0 (0x0).

Thanks in advance.

 

0 포인트
mecej4
명예로운 기여자 III
3,402 조회수

When you have a LP problem for which GAMS gave a solution but IMSL failed, there are two questions: (i) whether the same problem was given to the two solvers, and (ii). why are you comparing a 15 year old version of IMSL with (possibly) a current version of GAMS? Current versions of IMSL provide a newer routine for solving dense LP problems, called DENSE_LP.

The strategy of recasting an LP problem as an NLP problem in order to be able to try another solver is ill-advised, even if it succeeds, it is very inefficient. In your case, it also failed.

If you can post details of one small example where this happened (e.g., the fifth call to DLPRS), someone may be able to help you. Note, however, that at this stage the question belongs in an IMSL/Roguewave forum and not in a compiler forum.

0 포인트
sinereh_a_
초급자
3,402 조회수

thanks a lot. How may I use this DENSE_LP routine. I found an example of solving an LP with this routine but it seems my fortran does not support this routine. Should I install a newer version of CVF or add a newer IMSL to the current CVF?

 

0 포인트
Steven_L_Intel1
3,402 조회수

You would need to purchase Intel Visual Fortran Composer XE 2013 with IMSL - this includes the DENSE_LP routine mentioned. Your CVF code should build ok with minor adjustments for the IMSL changes.  For more information on that see What are the differences between Compaq* Visual Fortran and Intel Visual Fortran? and Configuring Visual Studio for using the IMSL* Fortran Numerical Library.

If purchasing, ignore the choices that include "Runtime" in the product name. The commercial part number is FXI999WSGE01, Academic is FXI999WSAE01.

0 포인트
mecej4
명예로운 기여자 III
3,497 조회수

sinereh a. wrote:

thanks a lot. How may I use this DENSE_LP routine. I found an example of solving an LP with this routine but it seems my fortran does not support this routine. Should I install a newer version of CVF or add a newer IMSL to the current CVF?

 

The last version of CVF sold was 6.6C. DEC was bought by Compaq and Compaq by HP. CVF is no longer sold as a current product, and you cannot buy a current version of IMSL for it. It will probably be quite difficult to get other versions of IMSL to work with CVF.

To use DENSE_LP, you need to do three things to your code: (i) change all REAL variables to DOUBLE PRECISION, and do likewise with real constants; (ii) replace, for example, [fortran]CALL DLPRS (M, NVAR, A, LDA, B, B, C1, IRTYPE, XLB, XUB, OBJ1, X1, DSOL)[/fortran] by [fortran]CALL DENSE_LP (A, B, B, C1, IRTYPE, OBJ1, X1, DSOL, XLB=XLB, XUB=XUB)[/fortran] and (iii) Add "USE DENSE_LP_INT" to your program.

0 포인트
sinereh_a_
초급자
3,498 조회수

I did these changes in my program. But I receive the following error:

 

--------------------Configuration: Bargaining_LP_check_3 - Win32 Debug-------------------- C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Bargaining_LP_check_3.f90(1): Could not find the file DENSE_LP_INT.mod. Compiling Fortran...

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Bargaining_LP_check_3.f90 C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Bargaining_LP_check_3.f90(1) : Error: Error in opening the Library module file.   [DENSE_LP_INT] USE DENSE_LP_INT ----^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Bargaining_LP_check_3.f90(38) : Error: Keyword arguments are invalid without an explicit interface.   [XLB] CALL DENSE_LP (AA2, BB2, BB2, C2, IRTYPEE, OBJ2, X2, DSOL, XLB=XLB, XUB=XUB) -----------------------------------------------------------^

C:\Documents and Settings\Administrator\Desktop\Fortran_2\FORTRAN\Bargaining_LP_check_3.f90(38) : Error: Keyword arguments are invalid without an explicit interface.   [XUB] CALL DENSE_LP (AA2, BB2, BB2, C2, IRTYPEE, OBJ2, X2, DSOL, XLB=XLB, XUB=XUB) --------------------------------------------------------------------^ Error executing df.exe.

Bargaining_LP_check_3.obj - 3 error(s), 0 warning(s)

I have attached the program too.

 

0 포인트
응답