help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] compile glpk in C++ using VC.NET


From: Liu, Cheng
Subject: [Help-glpk] compile glpk in C++ using VC.NET
Date: Fri, 30 Jul 2004 10:04:57 -0400

Hi,

This is not a request but a humble suggestion.

I have the following reasons to compile glpk in C++ using VC.NET

1.  I am using glpk as a training material to lean MIP especially Branch
and Bound.  From VS.NET developing environment, I can easily to follow
the logic of glpk by pressing <F10> key (go to next statement) in VC.NET
debugger.

2.  I would like to build a DLL/COM for glpk in order to use it in one
of projects.

In order to reach my goal, I have to do the followings:

1. change all file's extension to .cpp.

2. insert a "#include "stdafx.h"" line to the first line of each file.

3. change the struc names to unique names. (I found an article in the
internet stated that this is a bug in VC7 and it would be fixed under VS
2005)

4. change variable name "try" to "try1".  try is a reserve word in C++.

5. add explicit casting.  IN C++ a pointer of void can not be assigned
to a pointer of double although both of them are four bytes integers.
An explicit casting has to be used.  For example:

double * a = (double *) calloc(100, sizeof(double))

I have no problem to do the first 4 steps.  It can be done within 5
minutes but I spend three hours to finish step 5.  I need to change tons
of statements for the explicit casting just to satisfy my C++ compiler.


I know explicit casting is not required in C but it is important in C++.
Furthermore, it is not wrong if we do the explicit casting in C but
redundant.

I wish glpk had done the explicit casting so I don't have to spend
another three hours when the next version is released.  Meanwhile, glpk
will be C++ ready if we do the modification now.  Who knows someday and
someone may want to develop a branch and bound C++ class using standard
template library.

I will be happy if I can contribute anything in this topic.

Thanks,

cheng






reply via email to

[Prev in Thread] Current Thread [Next in Thread]