How to build GD from source?

I’m try to build GD from source on Ubuntu 14.04.1 LTS 64bit but I get this error message and end up with cmake files and empty folders in .build directory and nothing in Output directory:

[code]A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPkgConfig.cmake:337 (_pkg_check_modules_internal)
Extensions/TopDownMovementAutomatism/CMakeLists.txt:61 (pkg_check_modules)

Error in configuration process

CMAKE_BUILD_TYPE is empty, assuming build type is Release
CMake Error at CMakeLists.txt:35 (message):
Boost was not extracted in ExtLibs/boost. Refer to the documentation to
get the download link (
I have extracted Boost, SFML and wxWidgets to ExtLibs folder and also installed wxWidgets using the terminal command.

This is the very first time I’m using Cmake and try to build a C++ project from source, so I don’t know if I do wrong something, or something is missing.

Anybody could help pls?
Thanks :slight_smile:

Okay, I had to rename boost_1_55 directory to boost and also forget to install GTK-dev package. Now it building but very slowly. Will see :smiley:

No luck :imp:
After 13% I get this error message in terminal:

And a very long message in Cmake that I have copied in to a txt file and attached to this post.

Cmake_error.txt (42.4 KB)

Because Cmake error message was pointing to SFML many places, i was try to rebuild SFML, and I get this error message:

Why C++ is so complicated, why you just can’t open a single project file declared, imported everything inside it and run build , that s it, have a nice day :angry:

You need to use wxWidgets 3.0.1 instead of the provided WxWidgets 2.9.5 (causing some trouble with GTK3).
But, I first recommend you to learn C++ before doing anything with it.

Yes, probably I should learn C++ before I try to do anything with the source and external libs, but I hoped at least I can build GD from source easily, (it seemed easy by reading the documentation) well, I was wrong :laughing:
Thanks, anyway

In fact, that is easy, there is just a small workaround to do due go an incompatibility between libs.

I’ve just updated the documentation page about building GD: The paragraph about wxWidgets is now updated to use the latest version of the library. The SFML package is still not updated so you have to recompile it (there is a detailed page about it).

Newer languages like Ruby/PHP/Javascript have package manager that are easier to use (basically you just have to do “npm install” for a Javascript project using Node.js) and I agree that dependencies have always been a problem when dealing with large projects in C++.
I’m working on the doc and on the build system to try to make compiling GD as easy as possible but I can’t for example include all the dependencies inside the sources of GD (SFML and wxWidgets are too big, and the fact that binaries are incompatible between linux distro prevent me to publish precompiled package, except for a very specific distro like the latest Ubuntu).
(For now in fact, it’s easier to build GD on Windows, because you just have to extract the compiled libraries that I provide you and launch CMake).

But do not be discouraged, it’s normal that we get some problems for now as GD is just open sourced since a very short time. :slight_smile: The situation should evolve quickly :slight_smile:

Hm… How about script that would download everything for you and set up the build environment? Like bat script I’ve done some time ago to set up extension dev env? This way you won’t need to include wxWidgets and SFML, only script that would download latest version and compile it for you.

I’m searching for a more robust solution, like integrating this process into CMake.

a build script would be nice. Arch linux has yaourt. It automatically checks for dependencies, then after installing them gets the source code from git and compiles it into a nice package. :smiley:

The nice thing about build scripts is that you can be very specific in the way you go through the build steps via the script and they leave very little room for errors.

Its basically why I use manjaro linux over ubuntu. The arch way of buidling from source is so much better. An entire day of trial and error turns into a few lines in the command line and then wait and watch the magic.

But then again, someone has to sit down and write the script in the first place, so everyone else can then easily get the latest and greatest from git.
Arch and arch based distros are really good compiling, very good for bleeding edge software too

The better would be something like a C++ package manager (just write the name of your dependencies, type “install” and everything is handled by this package manager and not by an outdated/not maintained script). But I guess we have to use a script for now.

I’ve setup a script : …
(Do a git pull to update your repository or redownload it).

I only tested it on my Ubuntu 14.04 for now! There is no support for error, and one should upgrade the script to support other package manager for other distro I think.