Solved

Problem with implicit type conversion...

Posted on 2003-12-11
5
309 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

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 …
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
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 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.

708 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

13 Experts available now in Live!

Get 1:1 Help Now