Solved

Visibroker 6 causing "member function already defined or declared" error

Posted on 2003-12-12
4
453 Views
Last Modified: 2007-12-19
Hello ,

I am currently trying to build my project using Visbroker 6.0 but keep receiving the following error.

d:\6.0\include\viostrm.h(85) : error C2535: 'class VISistream &__thiscall VISistream::operator >>(unsigned short &)' : member function already defined or declared
        d:\6.0\include\viostrm.h(67) : see declaration of '>>'
d:\6.0\include\viostrm.h(112) : error C2535: 'class VISistream &__thiscall VISistream::get(unsigned short *,unsigned int)' : member function already defined or declared
        d:\6.0\include\viostrm.h(106) : see declaration of 'get'
d:\6.0\include\viostrm.h(194) : error C2535: 'class VISostream &__thiscall VISostream::operator <<(unsigned short)' : member function already defined or declared
        d:\6.0\include\viostrm.h(175) : see declaration of '<<'
d:\6.0\include\viostrm.h(218) : error C2535: 'class VISostream &__thiscall VISostream::put(const unsigned short *,unsigned int)' : member function already defined or declared
        d:\6.0\include\viostrm.h(212) : see declaration of 'put'

Etc...

I have this project build and running using Visibroker 5.1 and it all works fine in the very same envirnoment.

The 'idl' files for the 5.1 project were build using 5.1 and the same 'idl' files for the 6.0 project were built using 6.0.

I have an idea that my problem lies in that wchar_t is a typedef for unsigned short in VC++ 6, but if this were true i should have had problems when building the 5.1 project.

Does anyone have any solution to my problem ..

This is the piece of code to which the firts error refers too ...

#if defined(_VIS_UNICODE)
#if defined(_VIS_STREAM_WCHAR)
    virtual VISistream& operator>>(wchar_t& x);
#else
    virtual VISistream& operator>>(VISWChar& x);
#endif
    virtual VISistream& operator>>(wchar_t *& c);
    // get_wstring in mbuf only for now!!
    //virtual VISistream& get_wstring(wchar_t *& c);
#endif
0
Comment
Question by:oddbin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 11

Expert Comment

by:cup
ID: 9933661
Looks like it is moaning about inline definitions in the header files.  

Also, just to be safe, make sure that the 5.1 headers are not in the include list in the tools options directories.  It may be mixing those up with your V6 headers.

Also, be warned that if you are using Unicode, TCHAR is 16 bits on Windows but 32 bits on many of the *nixs.
0
 

Author Comment

by:oddbin
ID: 9942411
From the borland website : http://info.borland.com/devsupport/bes/relnotes/6_0_preview/VBE60_Beta.html#VBC_FixList


Wide Char on Windows - Prior to MSVC7, wchar_t was not considered as a built-in type and was mapped to "unsigned short",
hence wrappers were created to differentiate "unsigned short" and wchar_t data.However in MSVC7 wchar_t is now corrected and is now considered a built-in type and this compliancy can be enabled by using the "/Zc:wchar_t" MSVC7 compilation switch. This switch is required for wchar_t compliancy as suggested by Microsoft.

In Summary , insert "/Zc:wchar_t" into the preprocessor defs in the C++ Project settings tab.
0
 
LVL 9

Expert Comment

by:tinchos
ID: 10356450
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ with points refunded

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
0
 

Accepted Solution

by:
amp072397 earned 0 total points
ID: 10389217
PAQed, with points refunded (100)

amp
Community Support Cleanup Moderator
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question