<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3157" name=GENERATOR></HEAD>
<BODY>
<DIV>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007>Hi:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=067411500-27112007>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.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=067411500-27112007>1. I have created a
CLP_interface like this:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007>----------------------------------------------------------------------------------------------------</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007> MODULE
clp_ifaces<BR>!<BR>! Interfaces to the CLP Version 6.0 functions for
use<BR>! with <SPAN class=015092717-27112007>C</SPAN><SPAN
class=015092717-27112007>ompaq</SPAN> Visual Fortran <SPAN
class=015092717-27112007>6.6</SPAN> (<SPAN class=015092717-27112007>C</SPAN>VF)
<BR>!<BR>! Written By: Jose L.
Ceciliano
On: 20 Nov 2007<BR>!<BR>!<BR>! Allow no implicit
declarations<BR>!<BR> implicit
none<BR>!<BR>! CLP functions' interfaces<BR>!<BR>!
Load the problem<BR>
INTERFACE<BR> function Clp_loadProblem(
model, numcols, numrows, start, & <BR>
&
column, valuem, collb, colub, obj, &<BR>
&
rowlb, rowub)<BR>!DEC$ ATTRIBUTES stdcall, alias:'_Clp_loadProblem@48' ::
Clp_loadProblem<BR>!DEC$ ATTRIBUTES value :: numcols, numrows<BR>!DEC$
ATTRIBUTES reference :: start, column, valuem, collb<BR>!DEC$ ATTRIBUTES
reference :: colub, obj, rowlb, rowub, model<BR>
use symtypes<BR> integer(IL) ::
Clp_loadProblem<BR> integer(IL), intent(in) ::
numcols, numrows<BR> integer(IL), intent(in) ::
start(*), column(*)<BR> real(RD), intent(in) ::
valuem(*), collb(*), colub(*)<BR> real(RD),
intent(in) :: obj(*), rowlb(*), rowub(*)<BR>
character(15), intent(in) :: model<BR> end
function Clp_loadProblem<BR> END
INTERFACE</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=067411500-27112007>!
<BR>! Read an mps file from the given
filename<BR>
INTERFACE<BR> function Clp_readMps( model,
filename, keepNames, ignoreErrors)<BR> use
symtypes<BR> integer(IL) ::
Clp_readMps<BR> integer(IL), intent(in) ::
keepNames, ignoreErrors<BR> character(15),
intent(in) :: model, filename<BR> end function
Clp_readMps<BR> END
INTERFACE<BR>!<BR>! Primal column
solution<BR>
INTERFACE<BR> function
Clp_primalColumnSolution(model)<BR>!DEC$ ATTRIBUTES stdcall,
alias:'_Clp_primalColumnSolution@8' :: Clp_primalColumnSolution<BR>!DEC$
ATTRIBUTES reference :: model<BR> use
symtypes<BR> integer(IL) ::
Clp_primalColumnSolution<BR> character(15),
intent(in) :: model<BR> end function
Clp_primalColumnSolution<BR> END
INTERFACE<BR>!<BR>! Objective
value<BR>
INTERFACE<BR> function
Clp_objectiveValue(model)<BR>!DEC$ ATTRIBUTES stdcall,
alias:'_Clp_objectiveValue@8' :: Clp_objectiveValue<BR>!DEC$ ATTRIBUTES
reference :: model<BR> use
symtypes<BR> integer(IL) ::
Clp_objectiveValue<BR> character(15), intent(in)
:: model<BR> end function
Clp_objectiveValue<BR> END
INTERFACE<BR>!<BR>! Dual algorithm - see
ClpSimplexDual.hpp for method<BR>
INTERFACE<BR> function Clp_dual(model,
ifValuesPass)<BR>!DEC$ ATTRIBUTES stdcall, alias:'_Clp_loadProblem@12' ::
Clp_loadProblem<BR>!DEC$ ATTRIBUTES value :: ifValuesPass<BR>!DEC$ ATTRIBUTES
reference :: model<BR> use
symtypes<BR> integer(IL) ::
Clp_dual<BR> integer(IL) ::
ifValuesPass<BR> character(15), intent(in) ::
model<BR> end function
Clp_dual<BR> END
INTERFACE<BR>!<BR> END MODULE
clp_ifaces</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007>----------------------------------------------------------------------------</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=067411500-27112007>2. I have created my
project defining in settings the following information:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=067411500-27112007>a) In C/C++
preprosessor/additional include directories:
C:\coin-win32-msvc6-24Feb06\include</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=067411500-27112007>b) In
Link/Object/library modules:
C:\coin-win32-msvc6-24Feb06\lib\*.lib</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=067411500-27112007>However, when I try
to link my project I get the following errors:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007></SPAN></FONT> </DIV>
<DIV><SPAN class=067411500-27112007><FONT face=Arial size=2>prueba1.obj : error
LNK2001: unresolved external symbol </FONT><A title=mailto:_Clp_loadProblem@48
href="mailto:_Clp_loadProblem@48"><FONT face=Arial
size=2>_Clp_loadProblem@48</FONT></A><BR><FONT face=Arial size=2>prueba1.obj :
error LNK2001: unresolved external symbol </FONT><A title=mailto:_CLP_DUAL@12
href="mailto:_CLP_DUAL@12"><FONT face=Arial
size=2>_CLP_DUAL@12</FONT></A><BR><FONT face=Arial size=2>prueba1.obj : error
LNK2001: unresolved external symbol </FONT><A title=mailto:_Clp_objectiveValue@8
href="mailto:_Clp_objectiveValue@8"><FONT face=Arial
size=2>_Clp_objectiveValue@8</FONT></A><BR><FONT face=Arial size=2>prueba1.obj :
error LNK2001: unresolved external symbol </FONT><A
title=mailto:_Clp_primalColumnSolution@8
href="mailto:_Clp_primalColumnSolution@8"><FONT face=Arial
size=2>_Clp_primalColumnSolution@8</FONT></A><BR><FONT face=Arial
size=2>Debug/prueba1.exe : fatal error LNK1120: 4 unresolved externals<BR>Error
executing link.exe.</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=067411500-27112007>prueba1.exe - 5
error(s), 1 warning(s)<BR></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007>-------------------------------------------------------------------</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=067411500-27112007>I think the problem
is with the Clp.lib file since it does not have any @number with its functions,
instead it has @ ??</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2><SPAN class=067411500-27112007>What could it
be the error? What I would need to do that I am not doing now? </SPAN><SPAN
class=067411500-27112007>Thanks in advance.</SPAN></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=067411500-27112007>Kind
regards,</SPAN></FONT></DIV>
<DIV><SPAN class=067411500-27112007><FONT face=Arial
size=2>Jose</FONT></DIV></SPAN>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=067411500-27112007></SPAN></FONT> </DIV></DIV></BODY></HTML>