473,386 Members | 1,644 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

compilation error: cannot be overloaded

Hello,

I am trying to compile C++ code which uses rogue wave 9.0 classes on
RHEL
4.0. I use gnu g++ compiler to compile the code.
Compiler is not able to match the right type of parameters to overload
the
methods of RW classes.
Below are the two methods among others in the rw/ep_scntn.h header
file
where compiler says cannot be overloaded.

RWBoolean contains(RWBoolean(*fn)(const_value,void*),void* x) const;
RWBoolean contains(RWBoolean(*fn)(value_type,void*),void* x) const
{ return base_type::contains(fn,x); }

Compiler is treating the first parameter in above methods as same.

When I issue a make command from one of our c++ module, I get below
error

/usr/bin/g++ -g -fpic -D_POSIX_SOURCE -DTRACING -D__EXTENSIONS__ -
D__RWCOMPILER_H__
-D_REENTRANT -D_RWCONFIG=8s -D_RWCONFIG_12d -D_RWSTDDEBUG -
DRWDEBUG -c
TrackListMap.C -I../inc -I/psalms/common/inc -I/psalms/common/Map/inc -
I/psalms/common/Scan/inc
-I/opt/ossasn1/linux-glibc2.2.trial/8.2.0-betaA/include -I/psalms/
common/ASNFw2/sep/inc
-I/psalms/common/DbFw/inc -I/psalms/common/DbFwMgr/inc -I/psalms/
common/Time/inc
-I/psalms/common/LoggingFw/inc -I/psalms/common/ExcepFw/inc -I/psalms/
common/ConfigFw/inc
-I/psalms/common/SdtArm/inc -I/opt/RogueWave/SourcePro -o
TrackListMap.o

In file included from ../inc/TrackListMap.h:18,
from TrackListMap.C:15:
/opt/RogueWave/SourcePro/rw/ep_scntn.h: In instantiation of
`RW_PCntnr<std::vector<const RWCString*, std::allocator<const
RWCString*,
RWTPtrOrderedVector<const RWCString, std::allocator<const RWCString*>
>,
const RWCString>':
/opt/RogueWave/SourcePro/rw/ep_seq.h:50: instantiated from
`RW_PSeq<std::vector<const RWCString*, std::allocator<const
RWCString*,
RWTPtrOrderedVector<const RWCString, std::allocator<const RWCString*>
>,
const RWCString>'
/opt/RogueWave/SourcePro/rw/tpordvec.h:65: instantiated from
`RWTPtrOrderedVector<const RWCString, std::allocator<const RWCString*>
>'
/psalms/common/Map/inc/MapFile.h:27: instantiated from here
/opt/RogueWave/SourcePro/rw/ep_scntn.h:92: error: `RWBoolean
RW_PCntnr<StdColl, RWColl, T>::contains(RWBoolean (*)(typename
StdColl::value_type, void*), void*) const [with StdColl =
std::vector<const
RWCString*, std::allocator<const RWCString*, RWColl =
RWTPtrOrderedVector<const RWCString, std::allocator<const RWCString*>
>, T =
const RWCString]' and `RWBoolean RW_PCntnr<StdColl, RWColl,
T>::contains(RWBoolean (*)(const T*, void*), void*) const [with
StdColl =
std::vector<const RWCString*, std::allocator<const RWCString*,
RWColl =
RWTPtrOrderedVector<const RWCString, std::allocator<const RWCString*>
>, T =
const RWCString]' cannot be overloaded
/opt/RogueWave/SourcePro/rw/ep_scntn.cc:96: error: `typename
RW_PCntnr<StdColl, RWColl, T>::value_type RW_PCntnr<StdColl, RWColl,
T>::find(RWBoolean (*)(typename StdColl::value_type, void*), void*)
const
[with StdColl = std::vector<const RWCString*, std::allocator<const
RWCString*, RWColl = RWTPtrOrderedVector<const RWCString,
std::allocator<const RWCString*, T = const RWCString]' and
`typename
RW_PCntnr<StdColl, RWColl, T>::value_type RW_PCntnr<StdColl, RWColl,
T>::find(RWBoolean (*)(const T*, void*), void*) const [with StdColl =
std::vector<const RWCString*, std::allocator<const RWCString*,
RWColl =
RWTPtrOrderedVector<const RWCString, std::allocator<const RWCString*>
>, T =
const RWCString]' cannot be overloaded
..........................
...........................
any idea why we get above error. and how to fix the same.

Thanks & Regards,
Prakash

Apr 20 '07 #1
1 7145
<pr***********@gmail.comwrote in message
news:11*********************@l77g2000hsb.googlegro ups.com...
: I am trying to compile C++ code which uses rogue wave 9.0 classes on
: RHEL
: 4.0. I use gnu g++ compiler to compile the code.
: Compiler is not able to match the right type of parameters to overload
: the
: methods of RW classes.
: Below are the two methods among others in the rw/ep_scntn.h header
: file
: where compiler says cannot be overloaded.
:
: RWBoolean contains(RWBoolean(*fn)(const_value,void*),void* x) const;
: RWBoolean contains(RWBoolean(*fn)(value_type,void*),void* x) const
: { return base_type::contains(fn,x); }
:
: Compiler is treating the first parameter in above methods as same.
Hmm, just making a best guess from this short code fragment:
Unless const_value and value_type are reference-types, the above
overload is indeed illegal.
The const-ness of a by-value parameter does not affect the
signature of a function. That is, the two following declarations
are not overloads, but refer to the exact same function:
void f( int a );
void f( int const a );

: any idea why we get above error. and how to fix the same.

Concretely, the following would be valid:
RWBoolean contains(RWBoolean(*fn)(const_value&,void*),void* x) const;
RWBoolean contains(RWBoolean(*fn)(value_type&,void*),void* x) const

[ Assuming typedef T value_type; typedef T const const_value; ]

If you need further guidance, please try to extract a
self-contained code sample that reproduces the error,
or ask on a forum dedicated to the Rogue Wave libraries...

I hope this helps,
Ivan
--
http://ivan.vecerina.com/contact/?subject=NG_POST <- email contact form
Brainbench MVP for C++ <http://www.brainbench.com

Apr 20 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jill Graham | last post by:
Hi, From time to time, I receive following error message when trying to access my website. When the error occurs, I have to recompile my dll until the error disappears (this without changing...
2
by: tuko | last post by:
Hello kind people. The folliowing code gives me a compilation error, under MSVC 6.0 and intel 8.0 compiler. It compiles fine with g++ 3.3.1 and borland 5.5 Can you tell me please if the code...
1
by: Jill Graham | last post by:
Hi, From time to time, I receive following error message when trying to access my website. When the error occurs, I have to recompile my dll until the error disappears (this without changing...
9
by: subramanian | last post by:
Hello. Consider the following code fragment : enum TestEnum { val1 = 10, val2 = 100, val3 = 1000 }; class Test { public : enum TestEnum { val1 = 1, val2 val3 }; Test(int i = 0, int j = 0,...
1
by: BSand0764 | last post by:
I'm getting an error that I can't seem to resolve. When I compile the Functor related logic in a test program, the files compile and execute properly (see Listing #1). However, when I...
3
by: subramanian100in | last post by:
Consider the following program: #include <iostream> using namespace std; class Base { public: Base(int x = 0);
3
by: Sindhu Rani | last post by:
i hav created 3 classes in 3 different files. am gettin an error durin compilation. wat shud i do??? C:\s\source>javac -d ..\classes devtestdrive.java devtestdrive.java:5: cannot resolve symbol...
4
by: pjr | last post by:
Hi.. I am trying to compile a set of code using aCC 3.52(HP-UX 11.00) and visibroker 3.3. I am running into following error. I appreciate any ideas that can help me resolve this error. ...
2
by: kevinr | last post by:
Hi, I am brand new to VB, and I am trying to deploy Office 2007 on my network here at work. We used part of this script to do another deployment, and I have taken pieces and tried to edit for this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.