Results 1 to 9 of 9

Thread: Error creating new project in c + +

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2012
    Posts
    3
    Platforms
    Windows

    Default Error creating new project in c + +

    Sem tÃ*tulo.jpg

    Arguments ?

    Generator ?

    help

    using win7 64bits

  2. #2
    Join Date
    Nov 2009
    Posts
    61
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Error creating new project in c + +

    Is there any particular reason why you want to use cmake instead of qmake?

    Usually, Qt works this way. You start with <your application name>.pro where you put information about your headers, source files, sql, translations etc. For instance:
    Qt Code:
    1. HEADERS += \
    2. header1.h \
    3. header2.h \
    4. class1.h
    5. class2.h
    6. class3.h
    7.  
    8. SOURCES += \
    9. main_source_file_with_main.cpp \
    10. source_for_class1.cpp \
    11. source_for_class2.cpp \
    12. source_for_class3.cpp \
    13.  
    14. OTHER_FILES += \
    15. any_file_that_may_be_needed_by_your_application.txt
    16.  
    17. RC_FILE += resource_file_eg_your_icon.rc
    18.  
    19. TRANSLATIONS += tranlsation_to_yuor_other_languages.ts
    20.  
    21. QT += sql
    To copy to clipboard, switch view to plain text mode 
    Then, you run
    Qt Code:
    1. qmake <your application name>.pro
    To copy to clipboard, switch view to plain text mode 
    which creates for you a Makefile in the application folder along with two other folders: debug and release (in Windows). You can then execute "make" without any argument (mingw32-make or nmake in windows and I think make in MAC OS X whichever compiler you want to use) and have an application ready to use. The default is to compile a debug version. You may also want to compile a "release" version by using "make release". In MAC OS X, the procedure is almost the same. However, there are slight system dependent tricks, for instance when you want to have an icon. The solution about works only in Windows system. In MAC OS X, it has to be done in different way.
    Last edited by ZikO; 25th August 2012 at 21:31.

  3. #3
    Join Date
    Aug 2012
    Posts
    3
    Platforms
    Windows

    Default Re: Error creating new project in c + +

    I think you got it wrong. I'll put the steps I follow to create the application and then the error.

    First I go to File> New file or Project> non-qtProject> Plain C + + project (CMake build)> then choose ... next screen ...

    I put the project name and location, then I click next.

    and this screen appears >> Sem tÃ*tulo.jpg

    after I click finish.

    and this screen appears >>Sem tÃ*tulo.jpg

    I click next and it appears that first screen

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Error creating new project in c + +

    You need to tell CMake which toolchain you have installed so that it can look for and use it to build your project.
    http://www.cmake.org/cmake/help/cmak...ion_Generators

    Your first screen shot shows a drop down asking for this information: it is the equivalent of the -G option to the cmake command line utility. If I recall correctly CMake looks for Visual Studio and uses that by default if present. It does not look for other possibilities and needs to be told of them.

  5. #5
    Join Date
    Aug 2012
    Posts
    3
    Platforms
    Windows

    Default Re: Error creating new project in c + +

    so I have to have installed visual studio? only that?

  6. #6
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Error creating new project in c + +

    In order to use CMake you need CMake installed; is is not part of Qt.
    In order to use Qt you need a C++ compiler; this is also not part of Qt (although the Qt SDK can install the MingW compiler and tools for you). You can use the full Microsoft Visual Studio, the Microsoft Window SDK (that includes a C++ compiler) or the MingW (GCC) tools: up to you. Whichever tools you you choose to use CMake needs to know about them in order to generate build commands using them. CMake makes a guess and uses the Microsoft tools if it finds them, otherwise you need to tell it what tools to use.

  7. #7
    Join Date
    Nov 2009
    Posts
    61
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Error creating new project in c + +

    If I may ask this question here, what is the difference between Qmake and CMake?

  8. #8
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Error creating new project in c + +

    qmake is part of the Qt library's supporting tools. It is used to generate platform/environment specific build instructions for a project from a project description (*.pro) that is (mostly) platform independent. The build instructions are typically output as a Makefile for a make utility.

    CMake is a third-party tool that provides a similar cross-platform build capability. Given a project description in CMakeLists.txt CMake will generate Makefiles (generally) matching the specified target tool set that can be used to build the project. KDE is a user of CMake.

    I think Qt beginners should start with qmake.

  9. #9
    Join Date
    Nov 2009
    Posts
    61
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Error creating new project in c + +

    Thanks Chris,

    Thanks to the link you have provided, I understood what CMake does and how powerful it can be. Of course, at my level of advance I am going to rely on QMake due to small projects I do but I remember CMake was mentioned in one of the video tutorials even for beginners and a lecturer clearly stated that QMake may not be the best option for larger projects. I was simply wondering when one of each is used over the other. Anyway, thanks for the answer.

Similar Threads

  1. Creating sis files for C project Using QtCreator
    By mathi in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 3rd April 2012, 11:51
  2. help creating a project file
    By Slewman in forum Qt Programming
    Replies: 10
    Last Post: 23rd December 2009, 11:42
  3. Replies: 3
    Last Post: 20th November 2009, 15:51
  4. Creating project in designer
    By safknw in forum Qt Tools
    Replies: 3
    Last Post: 10th May 2006, 14:11
  5. Compilation error creating a project on QT4.0.1??
    By darpan in forum Qt Programming
    Replies: 6
    Last Post: 8th March 2006, 08:16

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.