code integration problem

Hello gurus. I'm not an entirely inexperienced C++ programmer, but it has been a very long while since I have dug out the tools and I am struggling with some code integration.

Am using QT framework to get started and have imported an external library or two into the project.

Unfortunately I am unable to get the library to compile as the compiler is complaining about its inability to convert parameters. I suspect this is most likely to be a compiler versioning issue and suspect its a fairly simple fix to get things going, but I am unsure as to where to start.

The first error shown indicates that the compiler cannot convert from 'const std::string' to const' ZenLib::Ztring' and lots of typecast errors follow. I am fairly certain this code should compile as there is a published application based on it, so I assume that there is a missing compiler setting.

Would very much appreciate some assistance in getting this stuff to compile so I can move forward....

thanks

mark.
It would help if you posted the line of code that has the conversion error.

From the docs, you shouldn't really have a problem making a ZenLib::Ztring from an std::string.
http://zenlib.sourceforge.net/classZenLib_1_1Ztring.html
It's unfortunately one error of many, but conversion seems to be the main thread of all the problems, so I am assuming that fixing one will fix a lot of others...

This is the first function...

bool Riff_Handler::Open(const string &FileName)
{
//Init
PerFile_Error.str(string());
File_IsValid=false;
File_IsCanceled=false;
bool ReturnValue=true;

//Global info
delete Chunks; Chunks=new Riff();
Chunks->Global->File_Name=FileName;

//Opening file
if (!File::Exists(FileName) || !Chunks->Global->In.Open(FileName)) /// compilation error here
{
Errors<<FileName<<": File does not exist"<<endl;
PerFile_Error<<"File does not exist"<<endl;
return false;
}
Chunks->Global->File_Size=Chunks->Global->In.Size_Get();
Chunks->Global->File_Date=Chunks->Global->In.Created_Local_Get();
if (Chunks->Global->File_Date.empty())
Chunks->Global->File_Date=Chunks->Global->In.Modified_Local_Get();

//Base
Riff_Base::chunk Chunk;
Chunk.Content.Size=Chunks->Global->File_Size;
Options_Update();
....

bool File::Exists(const Ztring &File_Name); // is the prototype in the zenlib namespace...

....

Ztring constructors...

class Ztring : public tstring //for details about undocumented methods see http://www.sgi.com/tech/stl/basic_string.html
{
public :
//Constructor/destructor
Ztring () : tstring(){};
Ztring (const tstring& str) : tstring(str){};
Ztring (const tstring& str, size_type pos, size_type n=npos) : tstring(str, pos, n){};
Ztring (const Char* s, size_type n) : tstring(s, n){};
Ztring (const Char* s) : tstring(s){};
Ztring (size_type n, Char c) : tstring(n, c){};
#ifdef UNICODE
Ztring (const char* S) : tstring(){From_UTF8(S);};
Ztring (const char* S, size_type n) : tstring(){From_UTF8(S, 0, n);};
#endif //UNICODE

.... hope this gives you something to go on....

I am attempting to compile this using a Microsoft C++ compiler under the QT framework (QT Creator) in Windows 7

cheers,

mark
Which line has the error?

It's helpful if you use the code format tag around your code, it'll make it format it and add line numbers.
Topic archived. No new replies allowed.