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

Knitro

Pablo_Guerron
Beginner
1,186 Views
Hi all,
Does anyone have experience linking Intel Fortran and Knitro? I keep getting the error LNK2019 unresolved extern symbol. The paths are properly set but the error is still there.
Pablo
0 Kudos
5 Replies
mecej4
Honored Contributor III
1,186 Views
The recently released Knitro-8 for Windows-64 comes with a Fortran example, which works fine when compiled with the current Intel compiler for Windows.

cl /MT /c knitro_fortran.c
ifort exampleProgram.f problemQCQP.f knitro_fortran.obj knitro800.lib

The resulting program ran fine.

Please provide details on the problems that you ran into. In particular, how did you compile and link, and which function was flagged as an unresolved symbol?
0 Kudos
Pablo_Guerron
Beginner
1,186 Views
Thanks for your reply. I am using Microsoft Visual Studio 2008, and Intel Fortran 11.1.038 in Windows 7 (64 bit).
The functions reported as unresolved symbol are:ktrF_open_instance,ktrF_load_param_file,ktrF_init_problem,ktrF_solve,ktrF_close_instance.
Any suggestion is welcomed.
Pablo
0 Kudos
mecej4
Honored Contributor III
1,186 Views
You need to include the file knitro_fortran.c in your build. This file contains Fortran callable wrapper functions that in turn call the routines in the Knitro library.

See the commands used to build the example in my first reply.

0 Kudos
Pablo_Guerron
Beginner
1,186 Views
Even after including the knitro_fortran.obj, I get the same error. Am I forgetting to set a path? Thanks
0 Kudos
mecej4
Honored Contributor III
1,186 Views
The Intel Fortran compiler normally upper-cases external symbols on Win-64. You do not provide information on how you built the .OBJ files and which compiler options were used, so I do not know why the missing externals are not all upper-case. Check if your project options are messing things up as to name decoration.

The PATH environment variable does not affect which objects are processed by the linker.
0 Kudos
Reply