Solved

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

Posted on 2003-12-12
4
448 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
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now