Home

OFF-SOFT.net

OFF-SOFT.net

This site is support & information site of WEB,and Software. This site might help you that create software or Web Site…perhaps?[:]

VC + + 2008 Express and using the sample compiled Qt Preferences

Published on| May 9th, 2009 | 2 Comments.
Description:
To Qt officially released as LGPL started about three months. Little by little, LGPL work with, here and now with Qt seen an article about.
From the time when the GPL Qt, Qt and I want to use but was, and was failing to hand.
The best attraction of Qt is a cross-platform. The cross-platform development, not early. Also, there, this is Japan, Java is just. Java How many people believe. WEB applications cross-platform Java is also addicted.

Talk of Java, and about it, this time, Qt (cute) and I try to, first, I started preparing.
Therefore, I would like to write about the Qt development environment.
※ to do this, it takes time for a mile, please no hurry.

Download
Articles: VC + + 2008 Express to compile the sample using WTL and Preferences
Articles: ResEdit resource editor, and VC + + 2008 Exp. To be linked to

Articles: qmake with VC + + 2008 Express to create a project file

Sample source code you used here:


Use Qt LGPL version

LGPL was published in the website from a company like the handling of certain notes on the Japanese translation.
Now, license, LGPL is now, LGPL, so is to permit reverse engineering, it is clearly stated terms.
If you want to use, I have to be careful that you use to check the licensing firm.
The LGPL, public domain and is different. GPL and LGPL, and not commercial use is not writing a word. However, GPL is the case, GPL programs are created using the GPL automatically and the results are obliged to release the source code. Therefore, a business that is hard to use.
The limit, which is a little loose, LGPL. There are many opinions, at first glance, the general opinion (translation of Japanese) will guide describes, LGPL is that the SUTATIKKURINKU, GPL source code, cause a public duty in the same way as , otherwise (if it meets the other conditions of the license), the source code was developed is that you do not need to publish. However, LGPL is used to edit the ORIJINARUSOSUKODO, it is an obligation to publish results without exception.

First, compile
Install the downloaded Qt
- Note: CPU: 2.4 GHz Memory: 1.5 Gbyte takes about 15 minutes ... wait patiently ...

Installation can be done in accordance with the installation screen. The installation, experience, and Japanese space, '-' It is better to use special characters in directory names. This time, "C: \ Qt" to be installed.
In a subsequent preference,% Qt installation directory% is the directory where you installed.

After the installation, perform the following steps to compile.

  1. VC + + 2008 Express SUTATOAPPUMENYU in the "Visula Studio 2008 Command Prompt" opens a

  2. From the command prompt,% Qt installation directory% \ Qt to move the current directory
    1
    2
    3
    
    C:\Program Files\Microsoft Visual Studio 9.0\VC> cd C:\Qt\Qt
    C:\Qt\Qt> path=%path%;C:\Qt\bin
    C:\Qt\Qt> 
  3. The compiler to specify the VC + +2008
    1
    2
    
    C:\Qt\Qt> set QMAKESPEC=win32-msvc2008
    C:\Qt\Qt> 
  4. Qt to compile the first part of the environment
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    
    C:\Qt\Qt> configure -debug-and-release -D _CRT_SECURE_NO_WARNINGS
    Which edition of Qt do you want to use ?
    Type 'c' if you want to use the Commercial Edition.
    Type 'o' if you want to use the Open Source Edition.
    o
     
    This is the Qt for Windows Open Source Edition.
     
    You are licensed to use this software under the terms of
    the GNU General Public License (GPL) version 3
    or the GNU Lesser General Public License (LGPL) version 2.1.
     
    Type '3' to view the GNU General Public License version 3 (GPLv3).
    Type 'L' to view the Lesser GNU General Public License version 2.1 (LGPLv2.1).
    Type 'y' to accept this license offer.
    Type 'n' to decline this license offer.
     
    Do you accept the terms of the license?
    y
      ---- この'y'を入力後、環境のコンパイルが始まります...
       :
       :
       :
    C:\Qt\Qt> 
    - Note: CPU: 2.4 GHz Memory: 1.5 Gbyte hours for about a ... wait patiently ...

  5. Compile the Qt library and scoop a sample of
    1
    2
    3
    4
    5
    
    C:\Qt\Qt> nmake
       :
       :
       :
    C:\Qt\Qt> 
    - Note: CPU: 2.4 GHz Memory: 1.5 Gbyte about 16 hours ... wait patiently ...


Development environment
My Computer - [Properties] Environmental settings.


Environment variable name Value
QMAKESPEC win32-msvc2008 PATH % path%; C: \ Qt \ Qt \ bin \.; C: \ Qt \ Qt \ lib \.; C: \ Qt \ bin \.
- C: \ Qt \ Qt \ bin \: Qt - Lib directory and the Core DLL
- C: \ Qt \ Qt \ lib \: Qt - Lib DLL version of the Debug directory and the
- C: \ Qt \ bin \: Qt - basic exe / dll directory

After the set, OK button.


Explorer, please try running the sample.
If you perform well, I think that can be set correctly.
Correctly, if it do not work , please check again for any incorrect settings.

C: \ Qt \ Qt \ examples \ widgets \ analogclock \ release \ analogclock.exe

If you see the following screen is OK.



In VC + + "Hello world" Let's make the screen
1
2
3
4
5
6
7
8
9
10
11
12
#include "QApplication"
#include "QPushButton"
 
int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    QPushButton hello("Hello world");
    hello.resize(100, 30);
 
    hello.show();
    return app.exec();
}

The above source code (sample.cpp) Try to compile from the command line.

  1. VC + + 2008 Express SUTATOAPPUMENYU in the "Visula Studio 2008 Command Prompt" opens a

  2. From a command prompt, the directory with the sample source (example) c: \ temp and) to move the current directory to
    1
    2
    
    C:\Program Files\Microsoft Visual Studio 9.0\VC> cd C:\temp
    C:\temp> 
  3. From the command prompt, qmake is run, VC project file for compiling and executing
    1
    2
    3
    4
    5
    6
    7
    
    C:\temp> qmake -project
    C:\temp> qmake temp.pro
    C:\temp> nmake
       :
       : -- コンパイル実施
       :
    C:\temp> 
    Line 1: Automatic search of the source code under the current directory, "the current directory name. Pro" in the name of the Qt project file.

    Line 2: debug, release and create a directory.
    debug, release for MakeFile create.
    - Makefile.Debug, Makefile.Release
    Create a default MakeFile.
    - Makefile

    Line 3: Build implementation
    - By default, debug builds are conducted.
    If you want to build a release version,
    nmake release
    And.
    debug / release version if you want to build together,
    nmake all
    And.

  4. Let us create a running sample.exe please run. When you see the screen below is OK.


The above source code (sample.cpp) to try to compile with the IDE.

  1. VC + + 2008 Express brings up a

  2. IDE environment settings
    [Tools] -> [Optional] -> [Solutions and Projects -> [VC + + directory] -> In the Show directories: [Include files] Add
    • % Qt installation directory% \ Qt \ Include (example: C: \ Qt \ Qt \ include)

    [Tools] -> [Optional] -> [Solutions and Projects -> [VC + + directory] -> In the Show directories: Library files] Add
    • % Qt installation directory% \ Qt \ lib (example: C: \ Qt \ Qt \ lib)

  3. MakeFile Empty Project (Sample) to create the menu [File] - [New] - [Projects] Click.

    Left: whole, right of the screen: Select the MEIKUFAIRUPUROJEKUTO.


  4. Nmake project will change the way
    [Project] -> [Properties] -> [Configuration Properties] -> [Nmake] Open the.

    The following describes the command line.
    qmake-project
    qmake
    nmake debug
    Once entered, click OK.
    ※ The last line, release version, "nmake release" is specified.
    A line "qmake-project-t vcapp-o hello.pro" as the project name (hello.pro) can also be specified.
    If so, then change the file name to run hello.exe.
    Here, so the same command line, and then continued to explain.
    Note:
    KURINKOMANDORAIN is, "nmake debug-clean" look like.


    $ (ConfigurationName) \ vcsample.exe as by default, is specified only the file name, "$ (ConfigurationName) \" I'll have it before.
    The executable file is "sub-directory name. Exe" and it warned.
    ※ Qt together I'll spit in the Makefile.

    ※ In the same manner, release and then specify how to build.


  5. Sample.cpp used in the first copy, and then added to the project
    - Sample.cpp file, the directory must be directly under this project.

  6. Please try to build implementation
    --- Sample.exe is OK when you created.

  7. Let us create a running sample.exe please run. When you see the screen below is OK.



    When running with the IDE and must display the following screen.
    This should probably be ignored.


    Screen above,
    [Tools] -> [Optional] -> [Solutions and Projects -> [Build / run] -> At runtime, when the old form of the project:
    • Always build
    • Not built
    And either will not be output.
    If one wants to restore the "confirm build" if set to return to the original.

    Advantages of using the IDE and debug it.
    The debug version is, of course, debugging (break).
    Following the break, you can also look into the details.


IDE settings, each time you build to be done, qmake does not need to run.
If there are changes to the project, I can run, we often forget, and to run with each build.
In addition, we have not verified the details, but no problem if the source code under the directory will be a problem if it is different. Furthermore, when you want to set up a separate lib and add the path, and has many problems.

Articles: qmake with VC + + 2008 Express to create a project file

To create an environment, the author, was an all-day.
If you are reading this article, but a little, I would be in time.
Indeed, how can you think so, still, nothing to do with IEMASEN, from the amount of source code, Qt is fine, I was able to feel less.

For reference, release version of the optimization, O2 (running speed) is used.
File Size of the sample run: 8K
※ SERUU for it to work, MFC Similarly, Qt must not distribute the DLL with the.

Qt: QTGUI4.DLL (7MB), QTCORE4.DLL (2MB), msvcrt? ? . dll (0.3MB)
MFC: mfcxx.dll (1MB), msvcpxx.dll (0.5MB), msvcrxx.dll (0.4MB), msvcrt? ? . dll (0.3MB)

The distribution is only slightly larger?

Comments

2 Comments. “VC + + 2008 Express and using the sample compiled Qt Preferences”


  1. nota
    April 23rd, 2011 @ 07:41:22

    こんにちは
    QT Creatorを使用して間もないのでこのサイトはとても参考にさせていただいております。
    現在、dllを外部参照させようと文献をあさったり検索したりしているのですが、なかなか情報が少なく上手くいっておりません。お手数ですがお教えいただければ幸いです。
    よろしくお願い致します。

  2. master
    April 26th, 2011 @ 23:46:32

    基本的なクラスなら QLibrary で Win32 のLoadLibrary と同じことができた?と思いますよ。
    (プラグインのような)動的リンクをするができたと思います。

    DLL側は、QT Creatorで C++ライブラリ作成 – 共有 でプロジェクトを作成するとOK?だったと思います。

Leave a Reply







  • はてなブックマークへ追加する
  • Facebookでシェアする
  • twitter でつぶやく
  • Google Plusでシェアする
  • Pocketでシェアする
ページトップへ