Difference between revisions of "Getting Started/Build/Windows/GCC And MinGW"

Jump to: navigation, search
(Building kdelibs from svn)
 
(12 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 +
{{improve|''This page is outdated - please don't use it anymore unless you know exactly what you do. Use [[../emerge|emerge]] instead''}}
 +
 
{{KDE4}}
 
{{KDE4}}
 
{{improve|''This page has been moved out of [http://kdelibs.com/wiki/index.php/Building_KDElibs_4_using_MinGW_with_Qt_4.3 kdelibs.com] wiki page.''}}
 
{{improve|''This page has been moved out of [http://kdelibs.com/wiki/index.php/Building_KDElibs_4_using_MinGW_with_Qt_4.3 kdelibs.com] wiki page.''}}
Line 13: Line 15:
  
 
The kdewin-installer is available in a GUI and console-only form from
 
The kdewin-installer is available in a GUI and console-only form from
[http://download.cegit.de/kde-windows/installer/ the kdewin-installer download page].
+
[http://www.winkde.org/pub/kde/ports/win32/installer/ the kdewin-installer download page].
  
 
=== Using kdewin-installer to install the requirements ===
 
=== Using kdewin-installer to install the requirements ===
  
 
For the GUI version:
 
For the GUI version:
If you are running the Installer for the first time, you should have a look in the Settings page (klick on the button 'Settings'). You can select another installation directory if you want. I suggest to choose one that has no spaces in it for now, as it seems some parts of the kde4 buildsystem have problems with that. Choose the compiler you use and accept the Settings.
+
If you are running the Installer for the first time, you should have a look in the Settings page (click on the button 'Settings'). You can select another installation directory if you want. I suggest to choose one that has no spaces in it for now, as it seems some parts of the kde4 buildsystem have problems with that. Choose the compiler you use and accept the Settings.
  
 
You'll see a tree of all available packages on the right side. In that tree select kdesupport-mingw and win32libs in the ''all'' category under the dependecies subtree. This should select all packages that are needed to build kdelibs.  
 
You'll see a tree of all available packages on the right side. In that tree select kdesupport-mingw and win32libs in the ''all'' category under the dependecies subtree. This should select all packages that are needed to build kdelibs.  
Line 27: Line 29:
  
 
=== The Compiler ===
 
=== The Compiler ===
MinGW (Minimalist GNU for Windows) contains the GNU Compiler Collection (gcc) for MS Windows. You can either download it directly from [http://downloads.sourceforge.net/mingw/MinGW-5.1.2.exe?modtime=1166577337&big_mirror=1 here] or you select the package in the installer.  
+
MinGW (Minimalist GNU for Windows) contains the GNU Compiler Collection (gcc) for MS Windows. You can either download it directly from [http://switch.dl.sourceforge.net/sourceforge/mingw/MinGW-5.1.3.exe here] or you select the package in the installer.
  
 
=== CMake ===
 
=== CMake ===
Line 42: Line 44:
  
 
=== D-Bus for Windows ===
 
=== D-Bus for Windows ===
This library shouldn't be installed with the installer, you should rather [[Getting_Started/Build/KDE4/Windows/Building DBus|compile]] it yourself.
+
This library shouldn't be installed with the installer, you should rather [[Getting_Started/Build/Windows/Building DBus|compile]] it yourself.
  
 
=== Qt 4 ===
 
=== Qt 4 ===
This Framework can be downloaded with the installer, or you can [[Getting_Started/Build/KDE4/Windows/Building Qt 4|build it on your own]].
+
This Framework can be downloaded with the installer, or you can [[Getting_Started/Build/Windows/Building Qt 4|build it on your own]].
  
 
=== KDESupport Libraries ===
 
=== KDESupport Libraries ===
There are several libraries which will be required for building kdelibs. [[Getting Started/Build/KDE4/Windows/Building KDESupport Libraries|You may want to compile them yourself]] or simply download them using the KDEWin-Installer. You will need:
+
There are several libraries which will be required for building kdelibs. [[Getting Started/Build/Windows/Building KDESupport Libraries|You may want to compile them yourself]] or simply download them using the KDEWin-Installer. You will need:
 
*kdewin32
 
*kdewin32
 
*strigi
 
*strigi
Line 55: Line 57:
  
 
== Build kdelibs ==
 
== Build kdelibs ==
=== Setting up the users environment ===
+
=== Setting up the user's environment ===
  
 
The next step is setting up a proper environment to build KDE4 applications. This includes setting the PATH variable and some additional variables needed for CMake and running KDE applications.
 
The next step is setting up a proper environment to build KDE4 applications. This includes setting the PATH variable and some additional variables needed for CMake and running KDE applications.
  
The path C:\kde4\win32libs is used as the installation directory from the kdewin-installer. Obviously you have to change the actual values to suite your system. The Sources from SVN reside in C:\kde4\kdelibs-src.
+
The path C:\kde4\win32libs is used as the installation directory for the kdewin-installer. Obviously you have to change the actual values to suit your system. The Sources from SVN reside in C:\kde4\kdelibs-src.
  
 
Create a file environment.bat and add the following lines:<pre>
 
Create a file environment.bat and add the following lines:<pre>
 
@set SOURCE_PATH=C:\kde4\kdelibs-src
 
@set SOURCE_PATH=C:\kde4\kdelibs-src
@set INSTALL_PATH=C:\kde4\win32libs
+
@set INSTALL_PATH=C:\kde4
  
 
@set DBUSDIR=%INSTALL_PATH%
 
@set DBUSDIR=%INSTALL_PATH%
Line 75: Line 77:
  
 
You will have to run this file every time you start a new cmd-shell. If you don't want to run this file you can make the variable entries permanent:
 
You will have to run this file every time you start a new cmd-shell. If you don't want to run this file you can make the variable entries permanent:
Open up the control panel and select the System Entry. Then go to the Extended tab and select Environment Variables. In the section titled 'user variables' add the above entries.
+
Open up the Control Panel and select the System entry (or press Win+Break). Then go to the Advanced tab and select Environment Variables. In the section titled 'User variables' add the above entries.
 
You should have cmake and mingw32-make etc. in your path as well.
 
You should have cmake and mingw32-make etc. in your path as well.
  
Line 119: Line 121:
 
==Useful links==
 
==Useful links==
  
List of libraries that are needed to build kde4 on windows (most of them are already installed by the kde-installer)
+
List of libraries that are needed to build kde4 on windows (they should be installed by the kde-installer)
  
[[Getting_Started/Build/KDE4/Windows/3rd-party_libraries|3rd-party libraries required for KDElibs 4]].
+
[[Getting_Started/Build/Windows/3rd-party_libraries|3rd-party libraries required for KDElibs 4]].
  
  
 
[[Category:MS Windows]]
 
[[Category:MS Windows]]

Latest revision as of 11:51, 3 March 2011

noframe
 
This section needs improvements: Please help us to

cleanup confusing sections and fix sections which contain a todo


This page is outdated - please don't use it anymore unless you know exactly what you do. Use emerge instead
Ktip.png
 
Tip
Note: This page is about KDE 4. It isn't applicable for KDE 3 development.
noframe
 
This section needs improvements: Please help us to

cleanup confusing sections and fix sections which contain a todo


This page has been moved out of kdelibs.com wiki page.

Contents

[edit] Introduction

This step-by-step tutorial shows how to get the current kdelibs from the upcoming KDE4 based on Qt4 compiled under Microsoft Windows.

[edit] Basic Tools

[edit] Installing kdewin-installer

This is a program that lets you easily install all the requirements for building kdelibs. It also has a list of tools in its list that are helpful and needed, like the mingw compiler suite, subversion clients, debugging tools and so on.

The kdewin-installer is available in a GUI and console-only form from the kdewin-installer download page.

[edit] Using kdewin-installer to install the requirements

For the GUI version: If you are running the Installer for the first time, you should have a look in the Settings page (click on the button 'Settings'). You can select another installation directory if you want. I suggest to choose one that has no spaces in it for now, as it seems some parts of the kde4 buildsystem have problems with that. Choose the compiler you use and accept the Settings.

You'll see a tree of all available packages on the right side. In that tree select kdesupport-mingw and win32libs in the all category under the dependecies subtree. This should select all packages that are needed to build kdelibs.

Additionally you might want to select the MinGW, cmake, TortoiseSVN, mingw-utils and zip package from the tools category if you haven't already installed those.

After clicking on 'Finish' the installer will download and install the packages. For mingw, cmake and tortoise it only downloads and starts an installer executable so expect more installation dialogs from those.

[edit] The Compiler

MinGW (Minimalist GNU for Windows) contains the GNU Compiler Collection (gcc) for MS Windows. You can either download it directly from here or you select the package in the installer.

[edit] CMake

CMake is the make tool used by KDE.

  • if you did not get it with the installer, use the most recent binaries from here http://www.cmake.org/files/v2.4/ (the filename should be like cmake-2.4.?-win32-x86.zip; you can also pick an .exe file instead of .zip). Make sure you use at least cmake 2.4.5
  • or get CMake from CVS and compile it yourself.

Install cmake in a path without spaces to avoid troubles (at least under win2k).


[edit] Compile and Install additional libraries

These libraries have to be installed:

[edit] D-Bus for Windows

This library shouldn't be installed with the installer, you should rather compile it yourself.

[edit] Qt 4

This Framework can be downloaded with the installer, or you can build it on your own.

[edit] KDESupport Libraries

There are several libraries which will be required for building kdelibs. You may want to compile them yourself or simply download them using the KDEWin-Installer. You will need:

  • kdewin32
  • strigi
  • soprano
  • qca2

[edit] Build kdelibs

[edit] Setting up the user's environment

The next step is setting up a proper environment to build KDE4 applications. This includes setting the PATH variable and some additional variables needed for CMake and running KDE applications.

The path C:\kde4\win32libs is used as the installation directory for the kdewin-installer. Obviously you have to change the actual values to suit your system. The Sources from SVN reside in C:\kde4\kdelibs-src.

Create a file environment.bat and add the following lines:
@set SOURCE_PATH=C:\kde4\kdelibs-src
@set INSTALL_PATH=C:\kde4

@set DBUSDIR=%INSTALL_PATH%
@set KDEDIRS=%INSTALL_PATH%
@set KDEWIN_DIR=%INSTALL_PATH%
@set PATH=%INSTALL_PATH%\bin;%INSTALL_PATH%\lib;%PATH%
@set QT_PLUGIN_PATH=%INSTALL_PATH%\lib\kde4\plugins;%INSTALL_PATH%\plugins
@set STRIGI_HOME=%INSTALL_PATH%
@set XDG_DATA_DIRS=%INSTALL_PATH%\share

You will have to run this file every time you start a new cmd-shell. If you don't want to run this file you can make the variable entries permanent: Open up the Control Panel and select the System entry (or press Win+Break). Then go to the Advanced tab and select Environment Variables. In the section titled 'User variables' add the above entries. You should have cmake and mingw32-make etc. in your path as well.

[edit] Building kdelibs from svn

Now that all requirements are installed and the environment variables are set you can checkout the kdelibs module from
svn://anonsvn.kde.org/home/kde/trunk/KDE/kdelibs
into the dedicated source directory.

Afterwards create a new subdirectory inside the kdelibs source directory named build. Then open a command console, select Start->Run Command and type cmd into the field. Then navigate to the just created build directory.

The next step is running CMake. For an easy start just run (Using the installation directory that was set in the environment variables section):

cmake -G "MinGW Makefiles" .. -DCMAKE_INSTALL_PREFIX=%INSTALL_PATH%\
-DCMAKE_INCLUDE_PATH=%INSTALL_PATH%\include
-DCMAKE_LIBRARY_PATH=%INSTALL_PATH%\lib

This command should appear in just one line. Make sure that the paths contain no trailing "\".

You can set other CMake variables in the same way, also interesting might be to create a debug build. This can be achieved by adding -DCMAKE_BUILD_TYPE=Debug.

Now you can let MinGW build and install the module by issuing
mingw32-make
mingw32-make install

This will take some time.

[edit] Building KDE4 applications

The process for building other modules that contain applications that are of interest for you is the same as the process you've just done for kdelibs. There might be additional requirements for some KDE4 modules that you have to build first, in particular kdebase might be required (which in turn requires kdepimlibs).

[edit] Running KDE4 applications

This can be done from the same command window where you've built KDE4. Just type the application name and hit enter. This should automatically start all kde4 daemons and dbus which are required to run for kde4 applications.

For example after building and installing both kdevplatform and kdevelop module the KDevelop4 IDE can be started by executing kdevelop. If you get some errors about missing DLLs, make sure that all DLLs are set up in your PATH variable. You can add the path either by changing the environment variables over the control panel (be sure to restart cmd.exe!) or by entering (if C:\example\path\to\dll\lib is the location of the dll):

C:\>set PATH=C:\example\path\to\dll\lib;%PATH%

[edit] Troubles

If you experience any troubles with the build process feel free to join #kde-windows on irc.freenode.org.

[edit] Useful links

List of libraries that are needed to build kde4 on windows (they should be installed by the kde-installer)

3rd-party libraries required for KDElibs 4.


This page was last modified on 3 March 2011, at 11:51. This page has been accessed 27,484 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal