PDA

View Full Version : compilation error when including dumpcpp output



Jimmy2775
24th October 2007, 22:35
Hello everyone,

I am having problems using the .h and .cpp files generated by the dumpcpp.exe tool. I am writing code that works with third-party type libraries (.tlb). I had initially generated a .h and .cpp for one .tlb, added it to my project and included the header file in my code - it worked perfectly.

Now I've generated .h and .cpp files for another .tlb file and when I include the header in my source, I receive the following compilation error:


1>c:\qt\4.2.3\include\activeqt\../../src/activeqt/container/qaxobject.h(58) : error C2248: 'QObject::QObject' : cannot access private member declared in class 'QObject'
1> c:\qt\4.2.3\include\qtcore\../../src/corelib/kernel/qobject.h(275) : see declaration of 'QObject::QObject'
1> c:\qt\4.2.3\include\qtcore\../../src/corelib/kernel/qobject.h(96) : see declaration of 'QObject'
1> This diagnostic occurred in the compiler generated function 'QAxObject::QAxObject(const QAxObject &)'Any ideas what could be causing this to happen? Although the compiler output indicates the issue is in qaxobject.h, I'm certain that this is misleading. I'm wondering what kind of error conditions would cause this symptom. FYI I'm using the MSVC8 compiler.

Thanks,

Jimmy

wysota
25th October 2007, 06:30
Hard to say without seeing any code... Could we see your class?

Jimmy2775
25th October 2007, 17:22
Yeah that's the tough part. The .cpp generated by dumpcpp is over 33000 lines, so it's tough to post here...

I'm including the generated .h file in a .cpp file of mine, but the compilation error shows up when I add the #include statement for it - I haven't even got around to using it in my code yet.

I realize that doesn't make it easy to arrive at a solution - general ideas of what might be going wrong are appreciated, if you've got any.

wysota
25th October 2007, 17:25
Try including it after your Qt header files.

Jimmy2775
25th October 2007, 17:43
Thanks for the suggestion, wysota. I tried that, but the problem remains :(

jpn
25th October 2007, 20:18
Just to make sure, you do have QAxContainer module enabled, right? What happens if you try to instantiate a plain QAxObject?

Jimmy2775
25th October 2007, 20:28
Yes, it's enabled. I'm able to instantiate QAxObjects based on other libraries with no problem.

jpn
25th October 2007, 20:33
The error is saying that QObject copy constructor cannot be used since it's private, which is correct. But what makes compiler so mixed up at that point in qaxobject.h? Are you sure there's no semi-colon (";") missing anywhere before the include directive or so? I guess then it wouldn't compile even without the include though, but... :)

wysota
25th October 2007, 21:35
Could you try regenerating the wrapper? Maybe you changed its code by accident? Or the encoding is incorrect? You can also try generating a wrapper for some other component and see if you face the same issue.

Jimmy2775
25th October 2007, 23:41
The error is saying that QObject copy constructor cannot be used since it's private, which is correct. But what makes compiler so mixed up at that point in qaxobject.h? Are you sure there's no semi-colon (";") missing anywhere before the include directive or so? I guess then it wouldn't compile even without the include though, but... :)

That's the thing that really confuses me here: why would the compiler think that QAxObject is trying to call the QObject copy constructor? No, there's no semi-colon missing before the include... I wish it was that easy ;)


Could you try regenerating the wrapper? Maybe you changed its code by accident? Or the encoding is incorrect? You can also try generating a wrapper for some other component and see if you face the same issue.

I regenerated the wrapper but that didn't fix the problem. I have already generated a wrapper for another type library and it works fine.

Is it possible that somehow the library I'm trying to wrap is corrupt, or being misinterpreted by dumpcpp? I am able to view the library's interface through MSVS's Object Browser, which makes me assume that everything is fine with that component... maybe I'm wrong in that assumption?

I appreciate your ideas and suggestions.

Jimmy

wysota
26th October 2007, 08:19
Yes, it looks like the generator can't handle the component. I think you should report that to Trolltech - specifying the component id that caused the problem, maybe they can fix it.

Jimmy2775
26th October 2007, 17:33
Well I talked to the people who made the original .tlb and got another copy of it. I tried wrapping the new one but still got the same result, so I guess it's time to email Trolltech support.

Thanks for your suggestions - I'll post when I hear back from the trolls.

Jimmy

Jimmy2775
29th October 2007, 18:25
Just an update - after talking to Trolltech we determined that there was an issue with the type library. Oddly enough the error should have shown up when compiling the generated .cpp file, as opposed to including the header in another .cpp file. Trolltech implied that while the library was corrupt, the bizarre error was possibly the result of an issue with the dumpcpp tool.

They also gave me some code that I can add to the generated header file to allow my code to run without issue. Thanks for your suggestions wysota and jpn.

nirab_25
14th May 2010, 04:12
hey, i am facing this problem . please help me with a sample code snippet

thanks