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

x
?
Solved

Problem with implicit type conversion...

Posted on 2003-12-11
5
Medium Priority
?
317 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
4 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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
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 how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
Suggested Courses

824 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