Results 1 to 3 of 3

Thread: QAssistantClient on Mac OS X

  1. #1
    Join Date
    Oct 2006
    Posts
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question QAssistantClient on Mac OS X

    Hi. I am currently using QAssistantClient on Windows and Linux as a help tool for my application. However, when I try to compile on Mac with XCode, I get the following errors:

    Qt Code:
    1. error: QAssistantClient: No such file or directory
    2. error: invalid use of undefined type 'struct QAssistantClient'
    3. error: forward declaration of 'struct QAssistantClient'
    To copy to clipboard, switch view to plain text mode 

    I have installed qt-mac-opensource-4.3.2.dmg and when I comment the code related to QAssistantClient, the applications compiles and links just fine.

    In the project file I have added "CONFIG += assistant" as one is supposed to. Also, doing a "find /Library/Frameworks -name qassistantclient*" on Mac, it appears the header files are installed:
    Qt Code:
    1. /Library/Frameworks/QtAssistant.framework/Versions/4/Headers/qassistantclient.h
    2. /Library/Frameworks/QtAssistant.framework/Versions/4/Headers/qassistantclient_global.h
    To copy to clipboard, switch view to plain text mode 

    Is there anything else I need to specify in the project file other than "CONFIG += assistant" in order to make the compilation work on Mac?

    I'm grateful for any suggestions I can get.

  2. #2
    Join Date
    Oct 2006
    Posts
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QAssistantClient on Mac OS X

    For some reason QtAssistant.framework doesn't get added to the .xcodeproj file. I have compared the .pro files of the Qt example "simpletextviewer" and my application to find out why, but I don't see any important difference.

    This is simpletextviewer.pro
    Qt Code:
    1. CONFIG += assistant
    2.  
    3. QT += network
    4.  
    5. HEADERS = mainwindow.h \
    6. findfiledialog.h
    7. SOURCES = main.cpp \
    8. mainwindow.cpp \
    9. findfiledialog.cpp
    10.  
    11. # install
    12. target.path = $$[QT_INSTALL_EXAMPLES]/assistant/simpletextviewer
    13. sources.files = $$SOURCES $$HEADERS $$RESOURCES documentation *.pro
    14. sources.path = $$[QT_INSTALL_EXAMPLES]/assistant/simpletextviewer
    15. INSTALLS += target sources
    To copy to clipboard, switch view to plain text mode 

    And this is my applications .pro file:
    Qt Code:
    1. TEMPLATE = app
    2. TARGET = CotigEditorQt
    3. CONFIG += qt \
    4. warn_on \
    5. release \
    6. console \
    7. static \
    8. assistant
    9. QT += network
    10. HEADERS += suggestiondialog.h \
    11. qbmtextedit.h \
    12. encodingvalidator.h \
    13. optionsdialog.h \
    14. cotigeditor.h \
    15. aboutdialog.h \
    16. helpdialog.h \
    17. printpreview.h \
    18. searchdialog.h \
    19. spellcheckdialog.h
    20. SOURCES += suggestiondialog.cpp \
    21. qbmtextedit.cpp \
    22. encodingvalidator.cpp \
    23. optionsdialog.cpp \
    24. main.cpp \
    25. cotigeditor.cpp \
    26. aboutdialog.cpp \
    27. helpdialog.cpp \
    28. printpreview.cpp \
    29. searchdialog.cpp \
    30. spellcheckdialog.cpp
    31. FORMS += suggestiondialog.ui \
    32. optionsdialog.ui \
    33. aboutdialog.ui \
    34. helpdialog.ui \
    35. searchdialog.ui \
    36. spellcheckdialog.ui
    37. RESOURCES += CotigEditorQt.qrc
    38. TRANSLATIONS = translations/CotigEditorQt_ca.ts
    39. INCLUDEPATH += ../CotigMainProxyQt
    40. !macx:unix {
    41. message("Building for Linux.")
    42. LIBS += -L../CotigMainProxyQt \
    43. -lCotigMainProxyQt
    44. }
    45. macx {
    46. message("Building for Mac.")
    47. LIBS += -L../CotigMainProxyQt \
    48. -lCotigMainProxyQt
    49. QMAKE_INFO_PLIST = mac/Info.plist
    50. RC_FILE = mac/CotigEditorQt.icns
    51. localizations.files = mac/locversion.plist
    52. localizations.path = Contents/Resources
    53. QMAKE_BUNDLE_DATA += localizations
    54. }
    55. win32 {
    56. message("Building for Windows.")
    57. LIBS += -L../CotigMainProxyQt/release \
    58. -lCotigMainProxyQt
    59. }
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Oct 2006
    Posts
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QAssistantClient on Mac OS X

    I just wanted to post and say that my problem has been solved, although the solution isn't a very pretty one. If someone knows of a better way, please let me know.

    I have dropped XCode altogether, as I'm more accustomed to work with g++. I execute "qmake -spec macx-g++" to obtain the makefile for the project.

    I then edit the makefile and add "-I/Library/Frameworks/QtAssistant.framework/Versions/4/Headers" to the INCPATH.

    Then finally, I change "-framework QtAssistantClient" to "-framework QtAssistant" for LIBS in the makefile, as there is no framework called QtAssistantClient.

    Now everything builds just fine. However, it's a pain having to hand edit the makefile everytime it has been recreated.

    Does anyone know of a better way?

    I'm now using Qt 4.3.3, and it has been installed from the .dmg.
    Last edited by fahlen; 7th December 2007 at 10:38.

  4. The following user says thank you to fahlen for this useful post:

    jacek (7th December 2007)

Similar Threads

  1. C++ Ide
    By Walsi in forum Newbie
    Replies: 10
    Last Post: 29th March 2007, 14:55
  2. QAssistantClient not showing on example
    By derrickbj in forum Qt Programming
    Replies: 3
    Last Post: 13th October 2006, 20:42

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.