Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem with implicit type conversion...

Posted on 2003-12-11
5
Medium Priority
?
316 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

715 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