Clone of kdiff3 public repository http://sourceforge.net/p/kdiff3/code/ci/master/tree/kdiff3/
KDiff3 is a graphical text difference analyzer for up to 3 input files, provides character-by-character analysis and a text merge tool with integrated editor. It can also compare and merge directories. Diffuse is a graphical tool for comparing and merging text files.
Author: Joachim Eibl (joachim.eibl at gmx.de)Copyright: (C) 2002-2012 by Joachim EiblKDiff3-Version: 0.9.97
KDiff3 runs best on KDE but can be built without it, depending only on Qt-libs.These are available for Un*x, Windows, Mac.Thus there are many setup possibilities to consider.
From version 0.9.94 on the main target platform is KDE4/Qt4.For KDiff3 for KDE3/Qt3 use KDiff3-0.9.92 or older.
Contents
- Introduction
- License
- Requirements & Installation
- For KDE4
- With Qt4-libs, without KDE
- for Linux/Un*x
- for Windows
- Debugging with MinGW under Windows:
- for Mac: Building KDiff3 for Mac OSX (with Intel processor) as auniversal binary
- Creating and installing translation messages
- Additional hints
Introduction
KDiff3 is a program that
- compares and merges two or three input files or directories,
- shows the differences line by line and character by character (!),
- provides an automatic merge-facility and
- an integrated editor for comfortable solving of merge-conflicts
- has support for KDE-KIO (ftp, sftp, http, fish, smb),
- has an intuitive graphical user interface,
- provides a context menu for KDE-Konqueror and Windows-Explorer,
- supports 64 bit systems. (Some build issues are discussed in here.)
Do you want help translating? Read the README in the po-subdirectory!
License
Requirements & Installation
- for KDE4:From version 0.9.94 on KDiff3 supports KDE4.For installation on most distributions you usually also need these packages(names as on opensuse):
- g++ (g++, version 3.4 or newer)
- libqt4-devel (Qt4-libs, version 4.4.0 or newer)
- libkde4-devel (KDE4 Header files and development libraries)
- libkonq-devel (optional, needed for the kdiff3-plugin, if not installedthen the contextmenu plugin for konqueror won't be built.)
- cmake (>2.6, checks dependencies and creates the appropriate Makefiles foryour system)
Typically in a terminal (e.g. konsole) you cd into the kdiff3-directory andrun./configure kde4
. This script is essentially the same as these commands:Now KDiff3 should be ready to use. Typekdiff3
to start it.There should also be a entry in your KDE-start menu in'(Applications->)Development'.For creating a debug version:The<KDE4-prefix>
depends on your distribution:The commandkde4-config --prefix
should tell you.- For opensuse 11 use
/usr
.
- Building KDiff3 with Qt4-libs, but without KDE
- for Linux/Un*x
- for Windows
- for Mac
The version 0.9.97 requires Qt 4.4.0 or newer (from http://qt-project.org/) forcompilation.You always need:-kdiff3-0.9.97.tar.gz
- for Un*x:gcc
,g++
with version >=3.4.2Qt-X11-libraries
- for Windows:Qt-win-libs
If you have the Qt4 commercial edition, then compile withVisual Studio.NET 2003 or newer.If you use the Qt4 open source edition, then you'll needMinGW.I verified that compilation and debugging works withthese packages (probably newer ones will also work):- UseMinGW-5.1.4.exe
or newer to install the followingor newer:-gcc-core-3.4.5-20060117-1.tar.gz
-binutils-2.17.50-20060824-1.tar.gz
-gcc-g++-3.4.5-20060117-1.tar.gz
-mingw-runtime-3.14.tar.gz
-mingw32-make-3.81-2.tar.gz
-w32api-3.11.tar.gz
-gdb-6.3-2.exe
(for debugging)- for Mac:gcc
,g++
with version >=3.4.2Qt-Mac-libraries- Optional: Qt Creator IDE: Development environment optimized for Qt(from http://qt-project.org)Build-instructions (Un*x):Assuming Qt is correctly installed run './configure qt4' which essentiallydoes the same as:mkdir releaseQt
cd releaseQt
qmake ../src-QT4/kdiff3.pro
make
(orgmake
for GNU-Make)
Build-instructions (Windows):- If you use Qt Creator from the SDK just load the
src-QT4kdiff3.pro
file and build.On the command line (cmd.exe): set QTDIR=<QT4-dir>
e.g.:c:qt4.4.1
set 'PATH=%QTDIR%bin;%PATH%
- Prepare compiler settings:For Visual Studio run the respective
vsvars32.bat
For MinGW add the path: E.g. setPATH=c:mingwbin;%PATH%
- cd into the directory
kdiff3-0.9.97src-Qt4
and type qmake kdiff3.pro
- Either
nmake
for Visual Studio ormingw32-make
depending on what youhave.
Debugging with MinGW under Windows:- Qt Creator worked very well as debugger frontend too!
- Debugging without gdb on the console:
- The
qt-win-opensource-4.4.1-mingw.exe
only installs release dlls. Youwill have to compile the debug dlls yourself. Enter theqt-4.4.1-directory
and runconfigure -debug
and thenmingw32-make
. - cd into the directory kdiff3-0.9.97src-Qt4
- edit the file
Makefile.Debug
and in the LFLAGS replace-Wl,-subsystem,windows
with-Wl,-subsystem,console
(this isnecessary so that gdb can send a break signal to the running program) mingw32-make debug
(create a debuggable executable)gdb debugkdiff3.exe
- At the '(gdb)'-prompt type
run
and enter to start. - While the program runs you can't set breakpoints, first interrupt itwith Ctrl-C.
- Use
help
to find out about how to use gdb. (Important commands:run
,break
,backtrace
,print
,quit
)Using break with c++-methods requires to specify the parameter typestoo. Breakpoints in constructors might not work.
- The
Building KDiff3 (Qt4) for Mac OSX:0) Build with Qt Creator from the SDK and src-QT4kdiff3.pro.Building a universal binary (by Michael Schmidt, perhaps outdated):- Install Qt/Mac 4.x with thread support, static libraries and universalflag. (For Qt4 run 'configure -static'; only necessary if the final binaryshould not require shared Qt4-libs.)
cd .../kdiff3-0.9.97/src-QT4
3a) Create a makefile for kdiff3 by executing:qmake kdiff3.pro
3b) optionally generate XCode-Project (for debugging purposes only) byexecuting:qmake -spec macx-xcode kdiff3.pro
- Execute:
make
- After the build completes copy kdiff3 from the
kdiff3-0.9.97/src-QT4
directory to:/Applications
Creating and installing the translation messagesThe po directory contains translations from the KDE-translation teams.If you use the Qt-only-version of KDiff3, then the installation describedabove won't install translations automatically.To create and install the translations:cd .../kdiff3-0.9.97/po
sh create_qm_files install
(asks for a super user password)Just to create the files in the po directory (as needed for the windowsversion):sh create_qm_files local
![Kdiff3 for macbook Kdiff3 for macbook](/uploads/1/2/6/3/126348463/594453453.png)
(End of KDiff3 with Qt4-instructions)
Additional hints
Start from commandline:
- Comparing 2 files:
kdiff3 file1 file2
- Merging 2 files:
kdiff3 file1 file2 -o outputfile
- Comparing 3 files:
kdiff3 file1 file2 file3
- Merging 3 files:
kdiff3 file1 file2 file3 -o outputfile
Note that file1 will be treated as base of file2 and file3.
If all files have the same name but are in different directories, you canreduce typework by specifying the filename only for the first file. E.g.:
- Comparing 3 files:
kdiff3 dir1/filename dir2 dir3
(This also works in the open-dialog.)
If you start without arguments, then a dialog will appear where you canselect your files via a filebrowser.
For more documentation, see the help-menu or the subdirectory doc.
Have fun!