[Top][All Lists]

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

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

From: Andrew Makhorin
Subject: Re: [Help-glpk] compile glpk in C++ using VC.NET
Date: Fri, 30 Jul 2004 18:26:34 +0400

>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
>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
>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

You are doing unnecessary work. The only thing you need to use glpk
routines in your C++ program is to use the following construction:

extern "C" {
#include "glpk.h"

Do not change the extension ".c" to ".cpp", because glpk is written in
ANSI/ISO C, not in C++.

reply via email to

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