Languages And Compilers

From K-3D

Jump to: navigation, search


K-3D is written in ANSI C++, and has taken a strong stand on standards-compliance. The program - and many of its dependencies - use advanced features from the C++ language and the Standard Library, including partial template specialization and template methods.


As of this writing, K-3D builds cleanly using gcc 4, and this is the compiler used for most development work. As always, ensure that K-3D and all its dependencies have been built with the same compiler!


You may run though some troubles depending on your Linux distribution or system. GCC is known as the GNU Compiler Collection and includes front ends for various languages, including C and C++. The GCC 3.xx series introduced a new ABI, making binaries generated by GCC 3.0 incompatible with binaries generated by GCC 2.95 . There are no such incompatibilities with the C frontends. As a consequence, assume you have a Linux distibution built entirely with GCC 2.95 : either GCC 3.xx is also available, or you compile it by yourself; now compile a C++ program using GCC 3.xx . If your program links with C binaries only, it will work fine. Now, try to link your C++ program with an existing C++ library : this won't work! This is exactly what's happening when compiling K-3D using GCC 3.2, and linking with PLIB (a C++ game library) included in your distribution thus built using GCC 2.95 and conflicting.

To get GCC 3.xx ABI version number, type the following command:

$  g++ -E -dM - < /dev/null | awk '/GXX_ABI/ {print $3}'

Note: gcc 3.2 package from Suse is known not to be able to compile K-3D

GCC 2.96

GCC 2.96 is an unofficial release of gcc that has been known to produce unusable K-3D executables. It's possible that an incremental upgrade to gcc 2.96 may have fixed whatever problems existed in the past, so you may re-run configure with the --with-gcc-2-96 option to override this test. If you do so and continue to have problems, our recommendation is that you switch to gcc 2.95 or gcc 3.0 or above.

The GCC 2.95 series is an official GNU release. Starting with Red Hat Linux 7.0, Red Hat included a heavily patched CVS version of GCC in their distribution and named it 2.96. Red Hat included this version in the distribution because GCC 3.0 was not finished at the time, and they needed a compiler that worked well on all of their supported platforms, including IA64 and s390. The Linux distributor Mandrake also followed Red Hat's example and started shipping GCC 2.96 with their Linux-Mandrake 8.0 series.

The GCC team disclaimed any link with GCC 2.96 and issued an official response to GCC 2.96. Many developers around the world began having problems with GCC 2.96, and started recommending other compilers. Examples are Linux Kernel, Apache, MySQL, avifile and Wine.

Microsoft Visual C++ 8

It is likely that K-3D could be built using MSVC 8, since all of its dependencies (libsigc++ and gtkmm in particular) can be built with that compiler.

Microsoft Visual C++ 7

K-3D will not compile under MSVC 7 since it still doesn't support partial template specializations. To compile K-3D under Win32 use MinGW.

Microsoft Visual C++ 6

K-3D will not compile under MSVC 6 since it is a broken compiler that does not implement ANSI C++ and standard template libraries properly. To compile K-3D under Win32 use MinGW.

Personal tools