how to fix this library problem because of newer GCC build
Hi all,
I've just been been compiling some code on a new Debian install, however due to it having a newer build of GCC I get a lot of invalid conversion from ‘const char*’ to ‘char*’ I've spent an hour converting all my code to run correctly. However I've found a library file I use is now causing a problem as this uses char * in it's prototype. The lib is Devil a texture loader. In my code I had void ParticleGiveBith(PARENT_PARTICLE *parent, char *texture .... and this calls the Devil function with parent->texture_id=ilutGLLoadImage(texture); However I had to change my fuction to use const char so it says void ParticleGiveBith(PARENT_PARTICLE *parent,const char *texture... This now gives error: invalid conversion from ‘const char*’ to ‘char*’ error: initializing argument 1 of ‘GLuint ilutGLLoadImage(char*)’ as the devil function uses char*, is there anyway to fix this? I can't change Devil as I apt-get it, I could search for source and compile but this may cause even more problems messing around with a lib function, can anyone advise a way round this? Thanks :) |
If you can't fix the code, then more compilers can be installed.
apt-get install g++-4.3 ( etc. etc.) Or get a Debian Lenny gcc / g++ : more choice than Squeeze. Using, examples : g++-4.1 <code> make CC=gcc-4.1 CXX=g++-4.1 You can have all the "deb compat compilers" installed at the same time. They are built not to conflict with each other. .. |
Quote:
Code:
parent->texture_id=ilutGLLoadImage(const_cast<char *>(texture)); Code:
parent->texture_id=ilutGLLoadImage((char *)texture); |
Thanks both, I had already considered using a different GCC, but was leaving that to a last shot. I did try (char *) but it caused errors. Then when I read your post Zirias I realized I was using g++ :s. I don't programme in C++ but use the g++ compiler (for various reasons) and had totally forgotten! Thanks both
|
All times are GMT -5. The time now is 12:50 PM. |