🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c++.leda
Article #80

Problem with MS Visual C on WinNT

#80
From: Sara Langseth
Date: Wed, 13 Sep 1995 07:39
52 lines
2751 bytes
I am trying to use LEDA with Microsoft Visual C++ 2.2 on Windows NT.
I have made the appropriate makefiles, and modified system.h (the
microsoft compiler did not support function templates properly, it
seems).

Most (about 75%) of the LEDA files now compile successfully.  I am
hoping that someone can help me resolve the remaining problems.  There
is one particular error message which is occurring in a large number
of the remaining files, which are almost all in the src/graph_alg
directory.  Most of the files in this directory give the following
error during the compile:

_all_pa1.c
_all_pairs.c(35) : error C2676: "binary '['  : 'const class
edge_array<int>' does not define this operator or a conversion to a
type acceptable to the predefined operator"

This error occurs on lines 35, and 64 of _all_pairs.c.  It also occurs
in _bellman_ford.c lines 45, 46, 49, 57, 61, 62, 63, 64.  Also _bfs.c
lines 31, 37, 38.  Also in several other files.  The specific class
causing the error varies, but it is always the "binary '['" operator.

Here are some more messages:
_bellma2.c
_bellman_ford.c(45) : error C2676: binary '[' : 'class
node_array<class edge_struct *>' does not define this...
_bellman_ford.c(46) : error C2676: binary '[' : 'class
node_array<double>' does not define this operator or...
_bellman_ford.c(49) : error C2676: binary '[' : 'class
node_array<double>' does not define this operator or...
_bellman_ford.c(57) : error C2676: binary '[' : 'class
node_array<double>' does not define this operator or...
_bellman_ford.c(61) : error C2676: binary '[' : 'const class
edge_array<double>' does not define this operat...
_bellman_ford.c(62) : error C2676: binary '[' : 'class
node_array<double>' does not define this operator or...
_bellman_ford.c(63) : error C2676: binary '[' : 'class
node_array<double>' does not define this operator or...
_bellman_ford.c(64) : error C2676: binary '[' : 'class
node_array<class edge_struct *>' does not define this...

The manual states that this error message means that "The specified
operator (in this case "[") could not be used in its predefined form.
To use the operator you must overload it for the appropriate type, or
define a conversion to a type for which the operator is defined.

I can supply any other info you need to help me troubleshoot this.

Thanks!

Sara Langseth
sl@cs.brown.edu
Technical Details
Message-ID: <435n85$49o@cocoa.brown.edu>
Path: arc1-ca.pugleaf.net!cocoa.brown.edu!news

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!cocoa.brown.edu!news
From: sl@cs.brown.edu (Sara Langseth)
Newsgroups: comp.lang.c++.leda
Subject: Problem with MS Visual C on WinNT
Date: Wed, 13 Sep 1995 07:39:44 GMT
Organization: Brown University
Message-ID: <435n85$49o@cocoa.brown.edu>
NNTP-Posting-Host: cis-ts1-slip15.cis.brown.edu
X-Newsreader: Forte Free Agent 1.0.82