[Coin-lpsolver] CLP from Compaq Visual Fortran 6.6

William H. Patton pattonwh at comcast.net
Tue Nov 27 20:32:47 EST 2007


Use dumpbin /SYMBOLS  on the lib file.

C:\Program Files\Microsoft Visual Studio\VC98\Bin>dumpbin /SYMBOLS
libclp.lib >SYM.TXT

then look for your interface names.  They do not carry the @nn
decoration so

try removing the alias:'_Clp_loadProblem at 48' or dropping the @n.

 

1F0 00000000 SECT78 notype ()    External     | _Clp_loadProblem

3CB 00000000 SECTF4 notype ()    External     |
_Clp_primalColumnSolution

 

I think this is normal for stdcall DLL access. The leading _ is
typical C.

William

 

 

  _____  

From: coin-lpsolver-bounces at list.coin-or.org
[mailto:coin-lpsolver-bounces at list.coin-or.org] On Behalf Of Jose
Luis Ceciliano Meza
Sent: Tuesday, November 27, 2007 10:49 AM
To: coin-lpsolver at list.coin-or.org
Subject: [Coin-lpsolver] CLP from Compaq Visual Fortran 6.6

 

Hi:

 

Recently I have tried to create a Fortran interface to use CLP
from Visual Fortran. I am trying to use some advise from Matthew
Saltzman, and some experience that I have on using Lindo and CPLEX
with the same purpose. However, I am having some trouble. I would
like to show you what I have done and where my problem is in order
to get some help from you.

 

1. I have created a CLP_interface like this:

 

------------------------------------------------------------------
-------------------------------------

      MODULE clp_ifaces
!
!  Interfaces to the CLP Version 6.0 functions in alphabetic order
for use
!   with Digital Visual Fortran 5.0 (DVF) - note that these
interfaces will
!   also work with Microsoft Fortran Powerstation 4.0 if all
metacommand
!   prefixes are changed from !DEC$ to !MS$
!
!
!  Written By:  Jose L. Ceciliano                    On:  20 Nov
2007
!
!
!  Allow no implicit declarations
!
      implicit none
!
!  CLP functions' interfaces
!
!     Load the problem
      INTERFACE
      function Clp_loadProblem( model,  numcols, numrows, start, &

     &                          column, valuem, collb, colub, obj,
&
  &                         rowlb, rowub)
!DEC$ ATTRIBUTES stdcall, alias:'_Clp_loadProblem at 48' ::
Clp_loadProblem
!DEC$ ATTRIBUTES value :: numcols, numrows
!DEC$ ATTRIBUTES reference :: start, column, valuem, collb
!DEC$ ATTRIBUTES reference :: colub, obj, rowlb, rowub, model
      use symtypes
      integer(IL) :: Clp_loadProblem
      integer(IL), intent(in) :: numcols, numrows
      integer(IL), intent(in) :: start(*), column(*)
      real(RD), intent(in) :: valuem(*), collb(*), colub(*)
      real(RD), intent(in) :: obj(*), rowlb(*), rowub(*)
      character(15), intent(in) :: model
      end function Clp_loadProblem
      END INTERFACE

 

! 
!     Read an mps file from the given filename
      INTERFACE
      function Clp_readMps( model, filename, keepNames,
ignoreErrors)
      use symtypes
      integer(IL) :: Clp_readMps
      integer(IL), intent(in) :: keepNames, ignoreErrors
      character(15), intent(in) :: model, filename
      end function Clp_readMps
      END INTERFACE
!
!     Primal column solution
      INTERFACE
      function Clp_primalColumnSolution(model)
!DEC$ ATTRIBUTES stdcall, alias:'_Clp_primalColumnSolution at 8' ::
Clp_primalColumnSolution
!DEC$ ATTRIBUTES reference :: model
      use symtypes
      integer(IL) :: Clp_primalColumnSolution
      character(15), intent(in) :: model
      end function Clp_primalColumnSolution
      END INTERFACE
!
!     Objective value
      INTERFACE
      function Clp_objectiveValue(model)
!DEC$ ATTRIBUTES stdcall, alias:'_Clp_objectiveValue at 8' ::
Clp_objectiveValue
!DEC$ ATTRIBUTES reference :: model
      use symtypes
      integer(IL) :: Clp_objectiveValue
      character(15), intent(in) :: model
      end function Clp_objectiveValue
      END INTERFACE
!
!     Dual algorithm - see ClpSimplexDual.hpp for method
      INTERFACE
      function Clp_dual(model, ifValuesPass)
!DEC$ ATTRIBUTES stdcall, alias:'_Clp_loadProblem at 12' ::
Clp_loadProblem
!DEC$ ATTRIBUTES value :: ifValuesPass
!DEC$ ATTRIBUTES reference :: model
      use symtypes
      integer(IL) :: Clp_dual
      integer(IL) :: ifValuesPass
      character(15), intent(in) :: model
      end function Clp_dual
      END INTERFACE
!
      END MODULE clp_ifaces

------------------------------------------------------------------
----------

2. I have created my project defining in settings the following
information:

 

a) In C/C++ preprosessor/additional include directories:
C:\coin-win32-msvc6-24Feb06\include

b) In Link/Object/library modules:
C:\coin-win32-msvc6-24Feb06\lib\*.lib

 

However, when I try to link my project I get the following errors:

 

prueba1.obj : error LNK2001: unresolved external symbol
_Clp_loadProblem at 48
prueba1.obj : error LNK2001: unresolved external symbol
_CLP_DUAL at 12
prueba1.obj : error LNK2001: unresolved external symbol
_Clp_objectiveValue at 8
prueba1.obj : error LNK2001: unresolved external symbol
_Clp_primalColumnSolution at 8
Debug/prueba1.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.

 

prueba1.exe - 5 error(s), 1 warning(s)

 

------------------------------------------------------------------
-

 

I think the problem is with the Clp.lib file since it does not
have any @number with its functions, instead it has @ ??

 

What could it be the error? What I would need to do that I am not
doing now? Thanks in advance.

 

Kind regards,

Jose

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/clp/attachments/20071127/25b59e2d/attachment.html>


More information about the Clp mailing list