Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2003-12-12
4
Medium Priority
?
457 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
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 user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

927 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