1

Topic: Compiling the client

I'm trying to compile teeworlds client under ubuntu 13.10 and i'm getting the following long error message:
bam client_debug
[1/2] #1 c++ src/engine/client/text.cpp
In file included from other/freetype/include/freetype/config/ftconfig.h:42:0,
                 from other/freetype/include/freetype/freetype.h:33,
                 from src/engine/client/text.cpp:14:
other/freetype/include/freetype/config/ftoption.h:257:32: error: expected constructor, destructor, or type conversion before ‘(’ token
#define FT_EXPORT(x) __declspec(dllexport) x
                                ^
other/freetype/include/freetype/freetype.h:1671:3: note: in expansion of macro ‘FT_EXPORT’
   FT_EXPORT( FT_Error )
   ^
other/freetype/include/freetype/config/ftoption.h:257:32: error: expected constructor, destructor, or type conversion before ‘(’ token
#define FT_EXPORT(x) __declspec(dllexport) x
                                ^
other/freetype/include/freetype/freetype.h:1690:3: note: in expansion of macro ‘FT_EXPORT’
   FT_EXPORT( FT_Error )
...
src/engine/client/text.cpp: In member function ‘virtual void CTextRender::Init()’:
src/engine/client/text.cpp:459:32: error: ‘FT_Init_FreeType’ was not declared in this scope
   FT_Init_FreeType(&m_FTLibrary);
                                ^
src/engine/client/text.cpp: In member function ‘virtual CFont* CTextRender::LoadFont(const char*)’:
src/engine/client/text.cpp:470:70: error: ‘FT_New_Face’ was not declared in this scope
   if(FT_New_Face(m_FTLibrary, pFont->m_aFilename, 0, &pFont->m_FtFace))
                                                                      ^
bam: 'objs/engine/client/text_d.o' error 256
bam: error: a build step failed

2

Re: Compiling the client

I can confirm this.

3

Re: Compiling the client

I'm trying to compile teeworlds client under ubuntu 13.10 and i'm getting the following long error message:

Which Teeworlds version?

Not Luck, Just Magic.

4 (edited by i.gnatenko.brain 2014-01-19 11:35:04)

Re: Compiling the client

Huh! This bug in the freetype[0] wink

Just sent pull request[1], but it's only fixing including freetype.

[0]https://bugzilla.redhat.com/show_bug.cgi?id=1055154
[1]https://github.com/teeworlds/teeworlds/pull/1179

Proposed patches for teeworlds master, which will build with new freetype:
Available in my repo: https://github.com/ignatenkobrain/teewo … eetype_new

From 174ba365444d6e7a69ab6c26a9766e7b53515367 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Sun, 19 Jan 2014 13:00:41 +0400
Subject: [PATCH 1/2] ft: correctly include FreeType

We shouldn't include bundled freetype libs if we found freetype-config

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
---
 other/freetype/freetype.lua | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/other/freetype/freetype.lua b/other/freetype/freetype.lua
index aa5af22..c803503 100644
--- a/other/freetype/freetype.lua
+++ b/other/freetype/freetype.lua
@@ -23,14 +23,11 @@ FreeType = {
         end
         
         local apply = function(option, settings)
-            -- include path
-            settings.cc.includes:Add(FreeType.basepath .. "/include")
-            
             if option.use_ftconfig == true then
                 settings.cc.flags:Add("`freetype-config --cflags`")
                 settings.link.flags:Add("`freetype-config --libs`")
-                
             elseif option.use_winlib > 0 then
+                settings.cc.includes:Add(FreeType.basepath .. "/include")
                 if option.use_winlib == 32 then
                     settings.link.libpath:Add(FreeType.basepath .. "/lib32")
                 else
-- 
1.8.5.3
From 5d4cbb494425df459a646884c240b99c01a46119 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Sun, 19 Jan 2014 13:29:42 +0400
Subject: [PATCH 2/2] ft: Temporary hack for FreeType > 2.5.1

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
---
 other/freetype/freetype.lua | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/other/freetype/freetype.lua b/other/freetype/freetype.lua
index c803503..d15377a 100644
--- a/other/freetype/freetype.lua
+++ b/other/freetype/freetype.lua
@@ -24,7 +24,9 @@ FreeType = {
         
         local apply = function(option, settings)
             if option.use_ftconfig == true then
-                settings.cc.flags:Add("`freetype-config --cflags`")
+                -- XXX: Temporary hack for FreeType > 2.5.1
+                --settings.cc.flags:Add("`freetype-config --cflags`")
+                settings.cc.flags:Add("pkg-config freetype2 --cflags`")
                 settings.link.flags:Add("`freetype-config --libs`")
             elseif option.use_winlib > 0 then
                 settings.cc.includes:Add(FreeType.basepath .. "/include")
-- 
1.8.5.3

BTW, this problems in the freetype in $distroname and I wouldn't send second patch to teeworlds.

5

Re: Compiling the client

apt-get install libfreetype6-dev

this should solve the problem wink

uptee - a simple web interface for hosting and maintaining teeworlds servers
teerace - a website gathering results of trusted Race-mod servers providing global ranking and statistics
*gV* rox ^^