Solved

Problem with implicit type conversion...

Posted on 2003-12-11
5
312 Views
Last Modified: 2010-04-02
Hello,

I'm trying to compile the xerces library with Dev-C++ over MinGW, and I'm getting conversion errors from all of the conversions to wchar of XML strings... If I put the explicit cast [for example: (wchar_t *)]
Everything works, anyway I don't want to write all the casts while the code compiles properly over cygwin...

Is there any option to for the compiler to cast automatically all this things?

Thanks...

Abusimbel.
0
Comment
Question by:abusimbel
  • 2
5 Comments
 
LVL 1

Expert Comment

by:travd
ID: 9925729
Can you post the exact errors and the sample code?  It might be that the compiler has a hard time picking between two conversions that it considers equally good - different compilers may have different behavior in this regard.  It's unlikely there will be a flag to alliviate your problem - but you might be able to change one of the classes in such a way that the conversion issues don't arise.
0
 
LVL 3

Author Comment

by:abusimbel
ID: 9927013
Hello travd,

To post the sample code is not the point because is 20MB, but enough saying that is a code that compiles fine with MS VC6, and with the same compiler in different platform. But when I'm trying I'm getting the error "Invalid conversion from (type #1) to (type #2)", I don't know why happens, and maybe there is an option to avoid it... Like the -pedantic to for the ansi special...

Thanks again,
Roberto.
0
 
LVL 1

Accepted Solution

by:
travd earned 500 total points
ID: 9930342
Well what I'm saying is that gcc (which I assume you're using) is less tolerant of conversion problems than some other compilers.  We build for five platforms, with five different compilers, and when gcc is the only one to complain about some code, it's often a conversion problem.  I doubt there is a flag you can use to fix this - flags usually make the compilation warning/error process stricter, not more lenient.

You don't need to post 20 MB of code - but instread a single line that causes the erorrs, along with the definitions of the types in that line, and also the exact error message reported by the compiler for that message.

You can also try the option --disable-c-mbchar to gcc (or --enable-c-mbchar, but that should be the default).
0
 
LVL 9

Expert Comment

by:tinchos
ID: 10356313
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:

Accept: travd {http:#9930342}

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

Tinchos
EE Cleanup Volunteer
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

820 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