From jlcm at iie.org.mx Tue Nov 27 12:29:28 2007 From: jlcm at iie.org.mx (Jose Luis Ceciliano Meza) Date: Tue Nov 27 12:30:48 2007 Subject: [MsVisualStudio] CLP from Compaq Visual Fortran 6.6 Message-ID: <6D4EE64F451EA8449F52B36B23672E960146C465@EULER.iie.org.mx> 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 for use ! with Compaq Visual Fortran 6.6 (CVF) ! ! 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@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@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@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@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@48 prueba1.obj : error LNK2001: unresolved external symbol _CLP_DUAL@12 prueba1.obj : error LNK2001: unresolved external symbol _Clp_objectiveValue@8 prueba1.obj : error LNK2001: unresolved external symbol _Clp_primalColumnSolution@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/msvisualstudio/attachments/20071127/27bbc124/attachment.html