Results 1 to 14 of 14

Thread: compilation error when including dumpcpp output

  1. #1
    Join Date
    Jan 2006
    Location
    Edmonton, Canada
    Posts
    101
    Thanks
    13
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default compilation error when including dumpcpp output

    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:

    Qt Code:
    1. 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'
    2. 1> c:\qt\4.2.3\include\qtcore\../../src/corelib/kernel/qobject.h(275) : see declaration of 'QObject::QObject'
    3. 1> c:\qt\4.2.3\include\qtcore\../../src/corelib/kernel/qobject.h(96) : see declaration of 'QObject'
    4. 1> This diagnostic occurred in the compiler generated function 'QAxObject::QAxObject(const QAxObject &)'
    To copy to clipboard, switch view to plain text mode 
    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: compilation error when including dumpcpp output

    Hard to say without seeing any code... Could we see your class?

  3. #3
    Join Date
    Jan 2006
    Location
    Edmonton, Canada
    Posts
    101
    Thanks
    13
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: compilation error when including dumpcpp output

    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.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: compilation error when including dumpcpp output

    Try including it after your Qt header files.

  5. The following user says thank you to wysota for this useful post:

    Jimmy2775 (25th October 2007)

  6. #5
    Join Date
    Jan 2006
    Location
    Edmonton, Canada
    Posts
    101
    Thanks
    13
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: compilation error when including dumpcpp output

    Thanks for the suggestion, wysota. I tried that, but the problem remains

  7. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: compilation error when including dumpcpp output

    Just to make sure, you do have QAxContainer module enabled, right? What happens if you try to instantiate a plain QAxObject?
    J-P Nurmi

  8. #7
    Join Date
    Jan 2006
    Location
    Edmonton, Canada
    Posts
    101
    Thanks
    13
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: compilation error when including dumpcpp output

    Yes, it's enabled. I'm able to instantiate QAxObjects based on other libraries with no problem.

  9. #8
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,518 Times in 1,388 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: compilation error when including dumpcpp output

    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...
    J-P Nurmi

  10. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: compilation error when including dumpcpp output

    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.

  11. #10
    Join Date
    Jan 2006
    Location
    Edmonton, Canada
    Posts
    101
    Thanks
    13
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: compilation error when including dumpcpp output

    Quote Originally Posted by jpn View Post
    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

    Quote Originally Posted by wysota View Post
    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

  12. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: compilation error when including dumpcpp output

    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.

  13. #12
    Join Date
    Jan 2006
    Location
    Edmonton, Canada
    Posts
    101
    Thanks
    13
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: compilation error when including dumpcpp output

    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

  14. #13
    Join Date
    Jan 2006
    Location
    Edmonton, Canada
    Posts
    101
    Thanks
    13
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: compilation error when including dumpcpp output

    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.

  15. #14
    Join Date
    Jan 2010
    Location
    Dhaka, Bangladesh
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Re: compilation error when including dumpcpp output

    hey, i am facing this problem . please help me with a sample code snippet

    thanks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.