Compiling Wesnoth 0.4.8 on Linux

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
Dahrkon

Compiling Wesnoth 0.4.8 on Linux

Post by Dahrkon »

I get a whole mess of errors on one certain file when compiling. It happened to me on 0.4.7 also. Anyway, here are my system specs and the exact error I got.

Linux: Red Hat 9
GCC: 3.3.1
SDL: 1.2.6
I have mostly all the latest tools.

The Error====================================================

g++ -g -O2 -Wall -I. -Isrc -Isrc/tools -Isrc/widgets `sdl-config --cflags` `freetype-config --cflags` -c src/actions.cpp -o src/actions.o
g++ -g -O2 -Wall -I. -Isrc -Isrc/tools -Isrc/widgets `sdl-config --cflags` `freetype-config --cflags` -c src/ai.cpp -o src/ai.o
g++ -g -O2 -Wall -I. -Isrc -Isrc/tools -Isrc/widgets `sdl-config --cflags` `freetype-config --cflags` -c src/ai_attack.cpp -o src/ai_attack.o
g++ -g -O2 -Wall -I. -Isrc -Isrc/tools -Isrc/widgets `sdl-config --cflags` `freetype-config --cflags` -c src/ai_move.cpp -o src/ai_move.o
g++ -g -O2 -Wall -I. -Isrc -Isrc/tools -Isrc/widgets `sdl-config --cflags` `freetype-config --cflags` -c src/config.cpp -o src/config.o
g++ -g -O2 -Wall -I. -Isrc -Isrc/tools -Isrc/widgets `sdl-config --cflags` `freetype-config --cflags` -c src/dialogs.cpp -o src/dialogs.o
g++ -g -O2 -Wall -I. -Isrc -Isrc/tools -Isrc/widgets `sdl-config --cflags` `freetype-config --cflags` -c src/display.cpp -o src/display.o
g++ -g -O2 -Wall -I. -Isrc -Isrc/tools -Isrc/widgets `sdl-config --cflags` `freetype-config --cflags` -c src/filesystem.cpp -o src/filesystem.o
g++ -g -O2 -Wall -I. -Isrc -Isrc/tools -Isrc/widgets `sdl-config --cflags` `freetype-config --cflags` -c src/font.cpp -o src/font.o
src/font.cpp:15:21: SDL_ttf.h: No such file or directory
src/font.cpp:25: error: `TTF_Font' was not declared in this scope
src/font.cpp:25: error: parse error before `>' token
src/font.cpp:29: error: syntax error before `*' token
src/font.cpp:46: error: ISO C++ forbids declaration of `name' with no type
src/font.cpp:46: error: `fname' was not declared in this scope
src/font.cpp:47: error: syntax error before `<<' token
src/font.cpp:55: error: syntax error before `*' token
src/font.cpp:63: error: syntax error before `*' token
src/font.cpp:69: error: syntax error before `*' token
src/font.cpp:73: error: use of namespace `font' as expression
src/font.cpp:73: error: `TTF_STYLE_NORMAL' was not declared in this scope
src/font.cpp:73: error: ISO C++ forbids declaration of `TTF_SetFontStyle' with
no type
src/font.cpp:73: error: initializer list being treated as compound expression
src/font.cpp:75: error: syntax error before `<<' token
src/font.cpp:76: error: syntax error before `.' token
src/font.cpp:84: error: syntax error before `::' token
src/font.cpp:94: error: syntax error before `::' token
src/font.cpp:97: error: syntax error before `!=' token
src/font.cpp:101: error: ISO C++ forbids declaration of `TTF_Quit' with no type
src/font.cpp:102: error: parse error before `}' token
src/font.cpp:105: error: type specifier omitted for parameter `COLOUR'
src/font.cpp:105: error: parse error before `,' token
src/font.cpp: In function `SDL_Rect draw_text_line(...)':
src/font.cpp:112: error: `colour' undeclared (first use this function)
src/font.cpp:112: error: (Each undeclared identifier is reported only once for
each function it appears in.)
src/font.cpp:113: error: `TTF_Font' undeclared (first use this function)
src/font.cpp:113: error: parse error before `=' token
src/font.cpp:114: error: use of namespace `font' as expression
src/font.cpp:121: error: use of namespace `font' as expression
src/font.cpp:121: error: `text' undeclared (first use this function)
src/font.cpp:121: error: `TTF_RenderText_Blended' undeclared (first use this
function)
src/font.cpp:130: error: `x' undeclared (first use this function)
src/font.cpp:131: error: `y' undeclared (first use this function)
src/font.cpp:135: error: `area' undeclared (first use this function)
src/font.cpp:143: error: `gui' undeclared (first use this function)
src/font.cpp: At global scope:
src/font.cpp:157: error: type specifier omitted for parameter `COLOUR'
src/font.cpp:157: error: parse error before `,' token
src/font.cpp: In function `SDL_Rect draw_text(...)':
src/font.cpp:163: error: `txt' undeclared (first use this function)
src/font.cpp:175: error: `COLOUR' undeclared (first use this function)
src/font.cpp:175: error: parse error before `=' token
src/font.cpp:176: error: `size' undeclared (first use this function)
src/font.cpp:178: error: `col' undeclared (first use this function)
src/font.cpp:178: error: `BAD_COLOUR' undeclared (first use this function)
src/font.cpp:181: error: `GOOD_COLOUR' undeclared (first use this function)
src/font.cpp:194: error: `bg' undeclared (first use this function)
src/font.cpp: At global scope:
src/font.cpp:213: error: parse error before `}' token
make: *** [src/font.o] Error 1

End of Error =================================================

I'm stumped. Can anyone help me?
fmunoz
Founding Artist
Posts: 1469
Joined: August 17th, 2003, 10:04 am
Location: Spain
Contact:

Post by fmunoz »

src/font.cpp:15:21: SDL_ttf.h: No such file or directory
lib SDL_ttf is missing, either the header (the devel rpm) or all the library.
You can get it from
http://www.libsdl.org/projects/SDL_ttf/
or try your distro CDs.
Dahrkon

Compiling Wesnoth 0.4.8 on Linux

Post by Dahrkon »

Ok I got it to work. Thanks.
Post Reply