Results 1 to 8 of 8

Thread: Compilation of QT Property Browser

  1. #1

    Default Compilation of QT Property Browser

    Hello all,

    I am using QT 4 (the latest GPL version released by Nokia)

    I download QT Property Browser from doc.trolltech.com/solutions/4/qtpropertybrowser/index.html

    I am using VC++ 2008, with QT Visual Studio Add-In Installed.

    I try to build simple project, under qtpropertybrowser solution.

    Here is the error message I obtained :

    Qt Code:
    1. 1>------ Rebuild All started: Project: simple, Configuration: Release Win32 ------
    2. 1>Deleting intermediate and output files for project 'simple', configuration 'Release|Win32'
    3. 1>Moc'ing qtpropertybrowserutils_p.h...
    4. 1>RCC ..\..\src\qtpropertybrowser.qrc
    5. 1>MOC ..\..\src\qtvariantproperty.h
    6. 1>MOC ..\..\src\qtpropertybrowser.h
    7. 1>MOC ..\..\src\qtgroupboxpropertybrowser.h
    8. 1>MOC ..\..\src\qtbuttonpropertybrowser.h
    9. 1>MOC ..\..\src\qttreepropertybrowser.h
    10. 1>MOC ..\..\src\qtpropertymanager.h
    11. 1>MOC ..\..\src\qteditorfactory.h
    12. 1>Compiling...
    13. 1>qrc_qtpropertybrowser.cpp
    14. 1>qtvariantproperty.cpp
    15. 1>qttreepropertybrowser.cpp
    16. 1>..\..\src\qttreepropertybrowser.cpp(1091) : fatal error C1083: Cannot open include file: 'qttreepropertybrowser.moc': No such file or directory
    17. 1>qtpropertymanager.cpp
    18. 1>..\..\src\qtpropertymanager.cpp(6470) : fatal error C1083: Cannot open include file: 'qtpropertymanager.moc': No such file or directory
    19. 1>qtpropertybrowserutils.cpp
    20. 1>qtpropertybrowser.cpp
    21. 1>qtgroupboxpropertybrowser.cpp
    22. 1>qteditorfactory.cpp
    23. 1>..\..\src\qteditorfactory.cpp(2592) : fatal error C1083: Cannot open include file: 'qteditorfactory.moc': No such file or directory
    24. 1>qtbuttonpropertybrowser.cpp
    25. 1>main.cpp
    26. 1>Generating Code...
    27. 1>Build log was saved at "file://c:\Documents and Settings\yan-cheng.cheok\Desktop\qtpropertybrowser-2.5-opensource\qtpropertybrowser-2.5-opensource\examples\simple\release\BuildLog.htm"
    28. 1>simple - 3 error(s), 0 warning(s)
    29. ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
    To copy to clipboard, switch view to plain text mode 

    Any suggestion to pass the compilation will be very much appreciated.

  2. #2

    Default Re: Compilation of QT Property Browser

    OK. Finally I figure out the workaround, I need to manually run the following command before clicking on the build all button.

    Qt Code:
    1. moc qttreepropertybrowser > qttreepropertybrowser.moc
    2. moc qtpropertymanager > qtpropertymanager.moc
    3. moc qteditorfactory > qteditorfactory.moc
    To copy to clipboard, switch view to plain text mode 

    Not sure why. QT people should include these command in their build file

  3. #3
    Join Date
    Dec 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compilation of QT Property Browser

    I confirm there is a problem with the buildlib pro of the 2.5.1 file imported in VisualStudio VS2005 at least with QT 4.6
    - No import library created
    - No export in the library ( dll_export not defined )
    - Error message importing the pro file ( see ScreenShot attachment) with the last VS Addin

    I suceeded in compiling it without a problem with :
    Qt Code:
    1. cd buillib
    2. qmake
    3. nmake
    To copy to clipboard, switch view to plain text mode 

    but now i get some strange linking problems:

    I have a class derived from QtPropertyBrowser
    Qt Code:
    1. class PropertyEditor : public QtTreePropertyBrowser
    2. {
    3. Q_OBJECT
    4. public:
    5. PropertyEditor(QWidget *parent=0);
    6. ~PropertyEditor();
    7.  
    8. void setObject(QObject* object);
    9. public slots:
    10. void updateObjectProperty(QtProperty * property, const QVariant & value);
    11.  
    12. private:
    13. QObject* _object;
    14. QtVariantPropertyManager _manager;
    15. QtVariantEditorFactory _factory;
    16. };
    To copy to clipboard, switch view to plain text mode 

    I get unresolved symbol in linking:
    Qt Code:
    1. public: static struct QMetaObject const QtTreePropertyBrowser::staticMetaObject" (?staticMetaObject@QtTreePropertyBrowser@@2UQMetaObject@@B)
    To copy to clipboard, switch view to plain text mode 


    Do someone have an idea about what could cause this kind of problem?

    I didn't have those problems with QT 4.5 and QtPropertyBrowser 2.5
    Attached Images Attached Images

  4. #4
    Join Date
    Mar 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compilation of QT Property Browser

    Ok, if anyone is still having problems, here is what worked for me ( after a day of beating my head against the computer ).
    Before opening the qtpropertybrowser.pro with VS2008
    cd to qtpropertybrowser dir using the VS2008 cmd then run
    >configure -library
    exit cmd,
    now open qtpropertybrowser.pro with VS and it should now open buildlib.pro properly as QtSolution_qtpropertybrowser_2.5.vsproject
    NOW... go to QtSolution_qtpropertybrowser's property window and browse to C/C++ -> Preprocessor
    there you should notice an entry called QT_QTPROPERTYBROWSER_IMPORT
    change that to QT_QTPROPERTYBROWSER_EXPORT ( that is the main culprit )
    and walla all of a sudden it compiles and no more missing *.moc files and inconsistent dll linkage warnings

  5. #5
    Join Date
    Feb 2010
    Location
    Sydney, Australia
    Posts
    111
    Thanks
    18
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compilation of QT Property Browser

    I still get the problem with the unfound *.moc files, even after changing to using QT_QTPROPERTYBROWSER_EXPORT. If I manually create just one of the MOC files using
    Qt Code:
    1. C:\Qt\4.6.2\bin\moc.exe .\qttreepropertybrowser.h > qttreepropertybrowser.moc
    To copy to clipboard, switch view to plain text mode 
    and rebuild I start getting a number of other errors (see otuput below). You will notice that there are still two MOC files missing, as expected. If I manually MOC those two remaining missing files I get literally hundreds of similar build errors.

    I'm using Qt 4.6.2, QtPropertyBrowser 2.5.1, Windows 7, VS 2008. If anyone has seen these errors and have managed to get them sorted out, please let me know.

    Thanks
    Stefan

    1>------ Build started: Project: QtSolutions_PropertyBrowser-2.5, Configuration: Debug Win32 ------
    1>Compiling...
    1>qttreepropertybrowser.cpp
    1>c:\users\stefan adelbert\documents\dev\iteration1\3rdparty\qtprope rtybrowser-2.5_1-opensource\src\qttreepropertybrowser.moc(20) : error C2370: 'qt_meta_data_QtTreePropertyBrowser' : redefinition; different storage class
    1> c:\Users\Stefan Adelbert\Documents\dev\iteration1\3rdParty\qtprope rtybrowser-2.5_1-opensource\buildlib\debug\moc_qttreepropertybrowse r.cpp(20) : see declaration of 'qt_meta_data_QtTreePropertyBrowser'
    1>c:\users\stefan adelbert\documents\dev\iteration1\3rdparty\qtprope rtybrowser-2.5_1-opensource\src\qttreepropertybrowser.moc(64) : error C2370: 'qt_meta_stringdata_QtTreePropertyBrowser' : redefinition; different storage class
    1> c:\Users\Stefan Adelbert\Documents\dev\iteration1\3rdParty\qtprope rtybrowser-2.5_1-opensource\buildlib\debug\moc_qttreepropertybrowse r.cpp(64) : see declaration of 'qt_meta_stringdata_QtTreePropertyBrowser'
    1>c:\users\stefan adelbert\documents\dev\iteration1\3rdparty\qtprope rtybrowser-2.5_1-opensource\src\qttreepropertybrowser.moc(79) : error C2374: 'staticMetaObject' : redefinition; multiple initialization
    1> c:\users\stefan adelbert\documents\dev\iteration1\3rdparty\qtprope rtybrowser-2.5_1-opensource\src\.\qttreepropertybrowser.h(62) : see declaration of 'staticMetaObject'
    1>c:\users\stefan adelbert\documents\dev\iteration1\3rdparty\qtprope rtybrowser-2.5_1-opensource\src\qttreepropertybrowser.moc(89) : error C2084: function 'const QMetaObject *QtTreePropertyBrowser::metaObject(void) const' already has a body
    1> c:\users\stefan adelbert\documents\dev\iteration1\3rdparty\qtprope rtybrowser-2.5_1-opensource\src\.\qttreepropertybrowser.h(62) : see previous definition of 'metaObject'
    1>c:\users\stefan adelbert\documents\dev\iteration1\3rdparty\qtprope rtybrowser-2.5_1-opensource\src\qttreepropertybrowser.moc(94) : error C2084: function 'void *QtTreePropertyBrowser::qt_metacast(const char *)' already has a body
    1> c:\users\stefan adelbert\documents\dev\iteration1\3rdparty\qtprope rtybrowser-2.5_1-opensource\src\.\qttreepropertybrowser.h(62) : see previous definition of 'qt_metacast'
    1>c:\users\stefan adelbert\documents\dev\iteration1\3rdparty\qtprope rtybrowser-2.5_1-opensource\src\qttreepropertybrowser.moc(102) : error C2084: function 'int QtTreePropertyBrowser::qt_metacall(QMetaObject::Ca ll,int,void **)' already has a body
    1> c:\users\stefan adelbert\documents\dev\iteration1\3rdparty\qtprope rtybrowser-2.5_1-opensource\src\.\qttreepropertybrowser.h(62) : see previous definition of 'qt_metacall'
    1>c:\users\stefan adelbert\documents\dev\iteration1\3rdparty\qtprope rtybrowser-2.5_1-opensource\src\qttreepropertybrowser.moc(162) : error C2084: function 'void QtTreePropertyBrowser::collapsed(QtBrowserItem *)' already has a body
    1> c:\users\stefan adelbert\documents\dev\iteration1\3rdparty\qtprope rtybrowser-2.5_1-opensource\src\.\qttreepropertybrowser.h(119) : see previous definition of 'collapsed'
    1>c:\users\stefan adelbert\documents\dev\iteration1\3rdparty\qtprope rtybrowser-2.5_1-opensource\src\qttreepropertybrowser.moc(169) : error C2084: function 'void QtTreePropertyBrowser::expanded(QtBrowserItem *)' already has a body
    1> c:\users\stefan adelbert\documents\dev\iteration1\3rdparty\qtprope rtybrowser-2.5_1-opensource\src\.\qttreepropertybrowser.h(120) : see previous definition of 'expanded'
    1>qtpropertymanager.cpp
    1>..\src\qtpropertymanager.cpp(6430) : fatal error C1083: Cannot open include file: 'qtpropertymanager.moc': No such file or directory
    1>qteditorfactory.cpp
    1>..\src\qteditorfactory.cpp(2552) : fatal error C1083: Cannot open include file: 'qteditorfactory.moc': No such file or directory
    1>Generating Code...
    1>Build log was saved at "file://c:\Users\Stefan Adelbert\Documents\dev\iteration1\3rdParty\qtprope rtybrowser-2.5_1-opensource\buildlib\debug\BuildLog.htm"
    1>QtSolutions_PropertyBrowser-2.5 - 10 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

  6. #6
    Join Date
    Feb 2010
    Location
    Sydney, Australia
    Posts
    111
    Thanks
    18
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compilation of QT Property Browser

    If I attempt to load just buildlib.pro into VS2008, after running configure.bat on a freshly extracted qtpropertybrowser 2.5.1, I get the following error: ..."Cannot add moc step to file..." (see attached screenshot).

    This is the import output:

    --- (Import): Generating new project of buildlib.pro file
    --- (qmake) : Using: c:\qt\4.6.2\bin\qmake
    --- (qmake) : Working Directory: C:\Qt\qtpropertybrowser-2.5_1-opensource\buildlib
    --- (qmake) : Arguments: -spec $(QTDIR)\mkspecs\win32-msvc2008 -tp vc "buildlib.pro" -o "buildlib.vcproj" QMAKE_INCDIR_QT=$(QTDIR)\include QMAKE_LIBDIR_QT= QMAKE_LIBDIR=$(QTDIR)\lib QMAKE_UIC=$(QTDIR)\bin\uic.exe QMAKE_MOC=$(QTDIR)\bin\moc.exe QMAKE_RCC=$(QTDIR)\bin\rcc.exe QMAKE_QMAKE=$(QTDIR)\bin\qmake.exe

    --- (qmake) : Exit Code: 0

    --- (Import): Added buildlib.vcproj to Solution


    When I atempt to build the project I (obviously) get the following error in the buid output:

    1>------ Build started: Project: QtSolutions_PropertyBrowser-2.5, Configuration: Debug Win32 ------
    1>Compiling...
    1>qrc_qtpropertybrowser.cpp
    1>moc_qtpropertybrowserutils_p.cpp
    1>qtvariantproperty.cpp
    1>qttreepropertybrowser.cpp
    1>qtpropertymanager.cpp
    1>qtpropertybrowserutils.cpp
    1>qtpropertybrowser.cpp
    1>qtgroupboxpropertybrowser.cpp
    1>qteditorfactory.cpp
    1>..\src\qteditorfactory.cpp(2552) : fatal error C1083: Cannot open include file: 'qteditorfactory.moc': No such file or directory
    1>qtbuttonpropertybrowser.cpp
    1>Generating Code...
    1>Build log was saved at "file://c:\Qt\qtpropertybrowser-2.5_1-opensource\buildlib\debug\BuildLog.htm"
    1>QtSolutions_PropertyBrowser-2.5 - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    Attached Images Attached Images

  7. #7
    Join Date
    Feb 2010
    Location
    Sydney, Australia
    Posts
    111
    Thanks
    18
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compilation of QT Property Browser

    I managed to get QtPropertyBrowser building, but I had to manually edit the "Generated Files" section of the vcproj file that was created by the Qt VS plugin to remove a bogus "Debug" filter and add a build directive for "qteditfactory.moc".

    I added the following to buildlib.vcproj:

    Qt Code:
    1. <File
    2. RelativePath="debug\qteditorfactory.moc"
    3. >
    4. <FileConfiguration
    5. Name="Debug|Win32"
    6. >
    7. <Tool
    8. Name="VCCustomBuildTool"
    9. Description="MOC ..\src\qteditorfactory.cpp"
    10. CommandLine="Rem IncrediBuild_AllowRemote&#x0D;&#x0A;Rem IncrediBuild_OutputFile debugqteditorfactory.moc&#x0D;&#x0A;&quot;$(QTDIR)\bin\moc.exe&quot; -D_WINDOWS -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_QTPROPERTYBROWSER_EXPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -D_WINDLL -I&quot;$(QTDIR)\include\QtCore\.&quot; -I&quot;$(QTDIR)\include\QtGui\.&quot; -I&quot;$(QTDIR)\include\.&quot; -I&quot;.\..\src\.&quot; -I&quot;$(QTDIR)\include\ActiveQt\.&quot; -I&quot;.\debug\.&quot; -I&quot;$(QTDIR)\mkspecs\win32-msvc2008\.&quot; &quot;..\src\qteditorfactory.cpp&quot; -o &quot;debug\qteditorfactory.moc&quot;&#x0D;&#x0A;"
    11. AdditionalDependencies="..\src\qteditorfactory.cpp;Rem"
    12. Outputs="debug\qteditorfactory.moc"
    13. />
    14. </FileConfiguration>
    15. <FileConfiguration
    16. Name="Release|Win32"
    17. >
    18. <Tool
    19. Name="VCCustomBuildTool"
    20. Description="MOC ..\src\qteditorfactory.cpp"
    21. CommandLine="Rem IncrediBuild_AllowRemote&#x0D;&#x0A;Rem IncrediBuild_OutputFile releaseqteditorfactory.moc&#x0D;&#x0A;&quot;$(QTDIR)\bin\moc.exe&quot; -DQT_NO_DEBUG -DNDEBUG -D_WINDOWS -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQT_QTPROPERTYBROWSER_IMPORT -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DNDEBUG -D_WINDLL -I&quot;$(QTDIR)\include\QtCore\.&quot; -I&quot;$(QTDIR)\include\QtGui\.&quot; -I&quot;$(QTDIR)\include\.&quot; -I&quot;.\..\src\.&quot; -I&quot;$(QTDIR)\include\ActiveQt\.&quot; -I&quot;.\release\.&quot; -I&quot;$(QTDIR)\mkspecs\win32-msvc2008\.&quot; &quot;..\src\qteditorfactory.cpp&quot; -o &quot;release\qteditorfactory.moc&quot;&#x0D;&#x0A;"
    22. AdditionalDependencies="..\src\qteditorfactory.cpp;Rem"
    23. Outputs="release\qteditorfactory.moc"
    24. />
    25. </FileConfiguration>
    26. </File>
    To copy to clipboard, switch view to plain text mode 

    I am now able to get a debug and release build of QtPropertyBrowser 2.5.1 using Qt 4.6.2 on Window 7. I believe that the problem here is a bug with the Qt VS plugin. Anyone care to comment on that?

  8. #8
    Join Date
    Feb 2010
    Location
    Sydney, Australia
    Posts
    111
    Thanks
    18
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Compilation of QT Property Browser

    I use static versions of this QtPropertyBrowser library because I get linker errors when attempting to use DLL's - something about staticMetaObject.

    These are the steps that I follow on Windows 7, Visual Studio 2008, Qt 4.6.3:

    1. Unpack the Files from the archive (qtpropertybrowser-2.5_1-opensource.zip)
    2. Change to the qtpropertybrowser-2.5_1-opensource directory
    3. Run the configure script (configure.bat): configure -library
    4. Run qmake: $(QTDIR)\bin.qmake.exe
    5. Manually run moc.exe on:
      1. qteditorfactory.h
      2. qtpropertymanager.h
      3. qttreebrowser.h
    6. Copy moc files to intermediate directories (Debug, Release)
    7. Open qtpropertybrowser.pro with Visual Studio Qt plugin
    8. Change the Configuration Type for both Debug and Release to Static Library (.lib)
    9. Change the Output Directory and the Intermediate Directory to $(ConfigurationName)
    10. For Release and Debug modes, change QT_QTPROPERTYBROWSER_IMPORT to QT_QTPROPERTYBROWSER_EXPORT for C++ >> Preprocessor >> Preprocessor Definitions
    11. Remove Post-Build Event which will attempt to copy a .dll to $(QTDIR)\bin
    12. Build Debug and Release libraries


    Once the libraries have been built they will be located at ...\qtpropertybrowser-2.5_1-opensource\buildlib\[Debug\Release]. Other libraries that link against them should refer to them there.

    With this set of steps I don't get any of the compiler or linker errors mentioned above.
    Last edited by stefanadelbert; 29th July 2010 at 04:09.

Similar Threads

  1. Replies: 2
    Last Post: 1st April 2009, 23:52
  2. Realisation of Property Editor (Browser) in Qt Jambi
    By Pavka in forum Qt Programming
    Replies: 0
    Last Post: 30th January 2009, 07:11
  3. Replies: 7
    Last Post: 14th March 2008, 13:52
  4. Invoking a browser...???
    By deepusrp in forum Newbie
    Replies: 4
    Last Post: 12th June 2007, 17:32
  5. Adding property editor file browser popup...
    By thawkins in forum Qt Tools
    Replies: 1
    Last Post: 25th April 2007, 23:03

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
  •  
Qt is a trademark of The Qt Company.