1

Topic: help compiling, totally lost

Hi everyone, I'm on Ubuntu and need to compile teeworlds so I can get tileset_borderfix and dilate because I'm trying to make a tileset. I've never compiled anything before and my ability to solve problems independently in doing so is basically zero.

I've tried to follow http://teeworlds.com/trac/teeworlds/wik … verything, but it doesn't work for me as written.

When I run

me@computer:~/Desktop/bam-0.2.0$ ./make_unix.sh

I get what seems to be an error:

src/main.c: In function ‘register_lua_globals’:
src/main.c:990: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result
src/main.c: In function ‘bam’:
src/main.c:1137: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result
/tmp/ccozsRym.o: In function `os_tmpname':
loslib.c:(.text+0x51): warning: the use of `tmpnam' is dangerous, better use `mkstemp'

And then when I do

me@computer:~/Desktop/teeworlds-0.5.2-src$ ../bam-0.2.0/src/bam release

nothing happens. I get:

--- Auto Configuration ---
[string "src/base.bam"]:597: no c/c++ compiler found
stack traceback:
  [string "src/base.bam"](597): Check method
    option = {...}
    settings = {...}
  [string "src/base.bam"](508): Autodetect method
    self = {...}
    (for generator) = 0x8f65a00 (function (6))
    (for state) = {...}
    (for control) = 1.000000
    k = 1.000000
    v = {...}
  [string "src/base.bam"](523): Finalize method
    self = {...}
    filename = 'config.bam'
  default.bam(11): (null) 
bam: error during build

Help? Thanks!

2

Re: help compiling, totally lost

[string "src/base.bam"]:597: no c/c++ compiler found

try to install g++ and gcc

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 ^^

3 (edited by Kottizen 2010-08-18 13:14:20)

Re: help compiling, totally lost

First, install some compilers and other good-to-have stuff:
sudo aptitude install build-essential

Then, remove the auto generated configuration file for bam:
rm -rf config.bam

And, at last, compile:
../bam-0.2.0/src/bam release

4

Re: help compiling, totally lost

Okay, did that (gcc was already installed). Then it did:

me@computer:~/Desktop/teeworlds-0.5.2-src$ ../bam-0.2.0/src/bam release
--- Auto Configuration ---
compiler: gcc
stackprotector: yes
zlib: (in system path)
sdl: not found (required)
saving configuration to 'config.bam'
--- 
bam: building 'release'
[  1/126] #1 c src/base/system.c
[  2/126] #1 c src/engine/e_network_client.c
[  3/126] #1 c src/engine/e_network_conn.c
[  4/126] #1 c src/engine/e_huffman.c
[  5/126] #1 c src/engine/e_map.c
[  6/126] #1 c src/engine/e_msg.c
[  7/126] #1 c src/engine/e_network_server.c
[  8/126] #1 c src/engine/e_memheap.c
[  9/126] #1 c src/engine/e_jobs.c
[ 10/126] #1 c src/engine/e_datafile.c
[ 11/126] #1 c src/engine/e_ringbuffer.c
[ 12/126] #1 c src/engine/e_packer.c
[ 13/126] #1 c src/engine/e_engine.c
[ 14/126] #1 c src/engine/e_network.c
[ 15/126] #1 c src/engine/e_config.c
[ 16/126] #1 c src/engine/e_linereader.c
[ 17/126] #1 c src/engine/e_keynames.c
[ 18/126] #1 c src/engine/e_console.c
[ 19/126] #1 c src/engine/e_demorec.c
[ 20/126] #1 c src/engine/e_snapshot.c
[ 21/126] #1 c src/engine/e_compression.c
[ 22/126] #1 c src/tools/dilate.c
In file included from src/tools/dilate.c:3:
src/tools/../engine/external/pnglite/pnglite.c: In function ‘png_init’:
src/tools/../engine/external/pnglite/pnglite.c:116: warning: assignment from incompatible pointer type
[ 23/126] #1 link dilate
[ 24/126] #1 c src/tools/packetgen.c
[ 25/126] #1 link packetgen
[ 26/126] #1 c src/tools/fake_server.c
[ 27/126] #1 link fake_server
[ 28/126] #1 c src/tools/map_resave.c
[ 29/126] #1 link map_resave
[ 30/126] #1 c src/tools/tileset_borderfix.c
In file included from src/tools/tileset_borderfix.c:3:
src/tools/../engine/external/pnglite/pnglite.c: In function ‘png_init’:
src/tools/../engine/external/pnglite/pnglite.c:116: warning: assignment from incompatible pointer type
[ 31/126] #1 link tileset_borderfix
[ 32/126] #1 c++ src/tools/crapnet.cpp
src/tools/crapnet.cpp: In function ‘int run(int, NETADDR)’:
src/tools/crapnet.cpp:203: warning: no return statement in function returning non-void
[ 33/126] #1 link crapnet
[ 34/126] #1 c++ src/mastersrv/mastersrv.cpp
[ 35/126] #1 link mastersrv
[ 36/126] #1 c++ src/versionsrv/versionsrv.cpp
[ 37/126] #1 link versionsrv
[ 38/126] #1 server_content_header > src/game/generated/gs_data.hpp
[ 39/126] #1 server_content_source > src/game/generated/gs_data.cpp
[ 40/126] #1 c++ src/game/generated/gs_data.cpp
[ 41/126] #1 network_header > src/game/generated/g_protocol.hpp
[ 42/126] #1 c++ src/game/server/gamemodes/ctf.cpp
[ 43/126] #1 c++ src/game/server/gamemodes/dm.cpp
[ 44/126] #1 c++ src/game/server/gamemodes/mod.cpp
[ 45/126] #1 c++ src/game/server/gamemodes/tdm.cpp
[ 46/126] #1 c++ src/game/server/gamecontext.cpp
[ 47/126] #1 c++ src/game/server/player.cpp
[ 48/126] #1 c++ src/game/server/eventhandler.cpp
[ 49/126] #1 c++ src/game/server/entities/projectile.cpp
[ 50/126] #1 c++ src/game/server/entities/character.cpp
[ 51/126] #1 c++ src/game/server/entities/pickup.cpp
[ 52/126] #1 c++ src/game/server/entities/laser.cpp
[ 53/126] #1 c++ src/game/server/gamecontroller.cpp
[ 54/126] #1 cmd5 src/game/generated/nethash.c
scripts/cmd5.py:1: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import md5, sys, re
[ 55/126] #1 c++ src/game/server/hooks.cpp
[ 56/126] #1 c++ src/game/server/entity.cpp
[ 57/126] #1 c++ src/game/server/gameworld.cpp
[ 58/126] #1 network_source > src/game/generated/g_protocol.cpp
[ 59/126] #1 c++ src/game/generated/g_protocol.cpp
[ 60/126] #1 c src/game/generated/nethash.c
[ 61/126] #1 c++ src/game/gamecore.cpp
[ 62/126] #1 c++ src/game/layers.cpp
[ 63/126] #1 c++ src/game/collision.cpp
[ 64/126] #1 c src/engine/server/es_register.c
[ 65/126] #1 c src/engine/server/es_server.c
[ 66/126] #1 link teeworlds_srv
[ 67/126] #1 c src/engine/external/wavpack/bits.c
[ 68/126] #1 c src/engine/external/wavpack/metadata.c
[ 69/126] #1 c src/engine/external/wavpack/wputils.c
[ 70/126] #1 c src/engine/external/wavpack/unpack.c
[ 71/126] #1 c src/engine/external/wavpack/float.c
[ 72/126] #1 c src/engine/external/wavpack/words.c
[ 73/126] #1 c src/engine/external/pnglite/pnglite.c
src/engine/external/pnglite/pnglite.c: In function ‘png_init’:
src/engine/external/pnglite/pnglite.c:116: warning: assignment from incompatible pointer type
[ 74/126] #1 c++ src/game/editor/ed_layer_game.cpp
[ 75/126] #1 c++ src/game/editor/ed_popups.cpp
[ 76/126] #1 client_content_header > src/game/generated/gc_data.hpp
[ 77/126] #1 c++ src/game/editor/ed_layer_tiles.cpp
[ 78/126] #1 c++ src/game/editor/ed_layer_quads.cpp
[ 79/126] #1 c++ src/game/editor/ed_editor.cpp
[ 80/126] #1 c++ src/game/editor/ed_io.cpp
[ 81/126] #1 c src/engine/client/ec_srvbrowse.c
[ 82/126] #1 c src/engine/client/ec_snd.c
src/engine/client/ec_snd.c:7:17: error: SDL.h: No such file or directory
src/engine/client/ec_snd.c:244: error: expected declaration specifiers or ‘...’ before ‘Uint8’
src/engine/client/ec_snd.c: In function ‘sdlcallback’:
src/engine/client/ec_snd.c:246: error: ‘stream’ undeclared (first use in this function)
src/engine/client/ec_snd.c:246: error: (Each undeclared identifier is reported only once
src/engine/client/ec_snd.c:246: error: for each function it appears in.)
src/engine/client/ec_snd.c: In function ‘snd_init’:
src/engine/client/ec_snd.c:251: error: ‘SDL_AudioSpec’ undeclared (first use in this function)
src/engine/client/ec_snd.c:251: error: expected ‘;’ before ‘format’
src/engine/client/ec_snd.c:261: error: ‘format’ undeclared (first use in this function)
src/engine/client/ec_snd.c:262: error: ‘AUDIO_S16’ undeclared (first use in this function)
src/engine/client/ec_snd.c:269: warning: implicit declaration of function ‘SDL_OpenAudio’
src/engine/client/ec_snd.c:271: warning: implicit declaration of function ‘SDL_GetError’
src/engine/client/ec_snd.c:277: warning: implicit declaration of function ‘SDL_PauseAudio’
src/engine/client/ec_snd.c: In function ‘snd_shutdown’:
src/engine/client/ec_snd.c:304: warning: implicit declaration of function ‘SDL_CloseAudio’
bam: command returned error: 256
bam: error during build

So it seems like there's a problem with sdl?
It did spit out dilate and tileset_borderfix files, but I don't know if they're working right or I'm attempting to use them right. Dragging and dropping a .png to be altered onto them (in either order, or one but not the other) alters the file, but tiling problems persist in-game.
Thanks for your help!

5

Re: help compiling, totally lost

In order to compile the client, you will need the SDL libraries:
sudo aptitude install libsdl-dev libsdl-image1.2 libsdl-image1.2-dev libsdl-mixer1.2 libsdl-mixer1.2-dev libsdl-sound1.2 libsdl-sound1.2-dev

Don't forget to remove the configuration file (config.bam) before you try to recompile it (only necessary after installing the libraries, not after each compilation).

6

Re: help compiling, totally lost

Okay, I did what steps I could.
I can't (slash don't know how to) use aptitude because I just upgraded OS's and aptitude is trying to remove some packages for software I still use that isn't supported anymore. But I checked for each mentioned package in Synaptic. I found and installed build-essential, libsdl-image1.2-dev, libsdl-mixer1.2-dev, libsdl-net1.2-dev, and libsdl-sound1.2-dev.

I still get the same error/message as mentioned above when I compile bam.
This is the output when I compile teeworlds. Seems like it mostly works?

--- Auto Configuration ---
compiler: gcc
stackprotector: yes
zlib: (in system path)
sdl: using sdl-config
saving configuration to 'config.bam'
--- 
bam: building 'release'
[  1/126] #1 c src/base/system.c
[  2/126] #1 c src/engine/e_network_client.c
[  3/126] #1 c src/engine/e_network_conn.c
[  4/126] #1 c src/engine/e_huffman.c
[  5/126] #1 c src/engine/e_map.c
[  6/126] #1 c src/engine/e_msg.c
[  7/126] #1 c src/engine/e_network_server.c
[  8/126] #1 c src/engine/e_memheap.c
[  9/126] #1 c src/engine/e_jobs.c
[ 10/126] #1 c src/engine/e_datafile.c
[ 11/126] #1 c src/engine/e_ringbuffer.c
[ 12/126] #1 c src/engine/e_packer.c
[ 13/126] #1 c src/engine/e_engine.c
[ 14/126] #1 c src/engine/e_network.c
[ 15/126] #1 c src/engine/e_config.c
[ 16/126] #1 c src/engine/e_linereader.c
[ 17/126] #1 c src/engine/e_keynames.c
[ 18/126] #1 c src/engine/e_console.c
[ 19/126] #1 c src/engine/e_demorec.c
[ 20/126] #1 c src/engine/e_snapshot.c
[ 21/126] #1 c src/engine/e_compression.c
[ 22/126] #1 c src/tools/dilate.c
In file included from src/tools/dilate.c:3:
src/tools/../engine/external/pnglite/pnglite.c: In function ‘png_init’:
src/tools/../engine/external/pnglite/pnglite.c:116: warning: assignment from incompatible pointer type
[ 23/126] #1 link dilate
[ 24/126] #1 c src/tools/packetgen.c
[ 25/126] #1 link packetgen
[ 26/126] #1 c src/tools/fake_server.c
[ 27/126] #1 link fake_server
[ 28/126] #1 c src/tools/map_resave.c
[ 29/126] #1 link map_resave
[ 30/126] #1 c src/tools/tileset_borderfix.c
In file included from src/tools/tileset_borderfix.c:3:
src/tools/../engine/external/pnglite/pnglite.c: In function ‘png_init’:
src/tools/../engine/external/pnglite/pnglite.c:116: warning: assignment from incompatible pointer type
[ 31/126] #1 link tileset_borderfix
[ 32/126] #1 c++ src/tools/crapnet.cpp
src/tools/crapnet.cpp: In function ‘int run(int, NETADDR)’:
src/tools/crapnet.cpp:203: warning: no return statement in function returning non-void
[ 33/126] #1 link crapnet
[ 34/126] #1 c++ src/mastersrv/mastersrv.cpp
[ 35/126] #1 link mastersrv
[ 36/126] #1 c++ src/versionsrv/versionsrv.cpp
[ 37/126] #1 link versionsrv
[ 38/126] #1 server_content_header > src/game/generated/gs_data.hpp
[ 39/126] #1 server_content_source > src/game/generated/gs_data.cpp
[ 40/126] #1 c++ src/game/generated/gs_data.cpp
[ 41/126] #1 network_header > src/game/generated/g_protocol.hpp
[ 42/126] #1 c++ src/game/server/gamemodes/ctf.cpp
[ 43/126] #1 c++ src/game/server/gamemodes/dm.cpp
[ 44/126] #1 c++ src/game/server/gamemodes/mod.cpp
[ 45/126] #1 c++ src/game/server/gamemodes/tdm.cpp
[ 46/126] #1 c++ src/game/server/gamecontext.cpp
[ 47/126] #1 c++ src/game/server/player.cpp
[ 48/126] #1 c++ src/game/server/eventhandler.cpp
[ 49/126] #1 c++ src/game/server/entities/projectile.cpp
[ 50/126] #1 c++ src/game/server/entities/character.cpp
[ 51/126] #1 c++ src/game/server/entities/pickup.cpp
[ 52/126] #1 c++ src/game/server/entities/laser.cpp
[ 53/126] #1 c++ src/game/server/gamecontroller.cpp
[ 54/126] #1 cmd5 src/game/generated/nethash.c
scripts/cmd5.py:1: DeprecationWarning: the md5 module is deprecated; use hashlib instead
  import md5, sys, re
[ 55/126] #1 c++ src/game/server/hooks.cpp
[ 56/126] #1 c++ src/game/server/entity.cpp
[ 57/126] #1 c++ src/game/server/gameworld.cpp
[ 58/126] #1 network_source > src/game/generated/g_protocol.cpp
[ 59/126] #1 c++ src/game/generated/g_protocol.cpp
[ 60/126] #1 c src/game/generated/nethash.c
[ 61/126] #1 c++ src/game/gamecore.cpp
[ 62/126] #1 c++ src/game/layers.cpp
[ 63/126] #1 c++ src/game/collision.cpp
[ 64/126] #1 c src/engine/server/es_register.c
[ 65/126] #1 c src/engine/server/es_server.c
[ 66/126] #1 link teeworlds_srv
[ 67/126] #1 c src/engine/external/wavpack/bits.c
[ 68/126] #1 c src/engine/external/wavpack/metadata.c
[ 69/126] #1 c src/engine/external/wavpack/wputils.c
[ 70/126] #1 c src/engine/external/wavpack/unpack.c
[ 71/126] #1 c src/engine/external/wavpack/float.c
[ 72/126] #1 c src/engine/external/wavpack/words.c
[ 73/126] #1 c src/engine/external/pnglite/pnglite.c
src/engine/external/pnglite/pnglite.c: In function ‘png_init’:
src/engine/external/pnglite/pnglite.c:116: warning: assignment from incompatible pointer type
[ 74/126] #1 c++ src/game/editor/ed_layer_game.cpp
[ 75/126] #1 c++ src/game/editor/ed_popups.cpp
[ 76/126] #1 client_content_header > src/game/generated/gc_data.hpp
[ 77/126] #1 c++ src/game/editor/ed_layer_tiles.cpp
[ 78/126] #1 c++ src/game/editor/ed_layer_quads.cpp
[ 79/126] #1 c++ src/game/editor/ed_editor.cpp
[ 80/126] #1 c++ src/game/editor/ed_io.cpp
[ 81/126] #1 c src/engine/client/ec_srvbrowse.c
[ 82/126] #1 c src/engine/client/ec_snd.c
[ 83/126] #1 c src/engine/client/ec_gfx.c
[ 84/126] #1 c src/engine/client/ec_inp.c
[ 85/126] #1 c src/engine/client/ec_client.c
[ 86/126] #1 c src/engine/client/ec_gfx_text.c
[ 87/126] #1 c src/engine/client/ec_font.c
[ 88/126] #1 client_content_source > src/game/generated/gc_data.cpp
[ 89/126] #1 c++ src/game/generated/gc_data.cpp
[ 90/126] #1 c++ src/game/client/render.cpp
[ 91/126] #1 c++ src/game/client/ui.cpp
[ 92/126] #1 c++ src/game/client/gameclient.cpp
[ 93/126] #1 c++ src/game/client/render_map.cpp
[ 94/126] #1 c++ src/game/client/animstate.cpp
[ 95/126] #1 c++ src/game/client/components/items.cpp
[ 96/126] #1 c++ src/game/client/components/particles.cpp
[ 97/126] #1 c++ src/game/client/components/maplayers.cpp
[ 98/126] #1 c++ src/game/client/components/voting.cpp
[ 99/126] #1 c++ src/game/client/components/binds.cpp
[100/126] #1 c++ src/game/client/components/players.cpp
[101/126] #1 c++ src/game/client/components/hud.cpp
[102/126] #1 c++ src/game/client/components/emoticon.cpp
[103/126] #1 c++ src/game/client/components/menus_demo.cpp
[104/126] #1 c++ src/game/client/components/controls.cpp
[105/126] #1 c++ src/game/client/components/sounds.cpp
[106/126] #1 c++ src/game/client/components/menus_settings.cpp
[107/126] #1 c++ src/game/client/components/chat.cpp
[108/126] #1 c++ src/game/client/components/motd.cpp
[109/126] #1 c++ src/game/client/components/mapimages.cpp
[110/126] #1 c++ src/game/client/components/damageind.cpp
[111/126] #1 c++ src/game/client/components/broadcast.cpp
[112/126] #1 c++ src/game/client/components/killmessages.cpp
[113/126] #1 c++ src/game/client/components/effects.cpp
[114/126] #1 c++ src/game/client/components/flow.cpp
[115/126] #1 c++ src/game/client/components/nameplates.cpp
[116/126] #1 c++ src/game/client/components/menus.cpp
[117/126] #1 c++ src/game/client/components/camera.cpp
[118/126] #1 c++ src/game/client/components/menus_ingame.cpp
[119/126] #1 c++ src/game/client/components/skins.cpp
[120/126] #1 c++ src/game/client/components/console.cpp
[121/126] #1 c++ src/game/client/components/menus_browser.cpp
[122/126] #1 c++ src/game/client/components/scoreboard.cpp
[123/126] #1 c++ src/game/client/components/debughud.cpp
[124/126] #1 c++ src/game/client/lineinput.cpp
[125/126] #1 c++ src/game/client/clienthooks.cpp
[126/126] #1 link teeworlds
bam: done

This leaves me with tileset_borderfix and dilate files that are exactly the same size as they were before, and still don't work unless I'm not using them correctly.
tileset_borderfix seems like it's inserting the right kinds of lines of pixels but not all in the right places and about 3 times as many as the stock game .png's appear to have.
But, I'm just dragging icons onto each other like an idiot here, I don't know if that's the right way to use program and I have no idea where to look to find out.
Another question I have is whether the file that you feed into these executables is supposed to be something smaller than 1024x1024 to start with, and if so doesn't that mean it shouldn't be able to hold the full 16x16 64px tiles? Are proper tiles actually supposed to be 63 pixels wide and tall?

Is there any FAQ anywhere that actually lays this all out?
Thanks very much for your help.

7

Re: help compiling, totally lost

If you got that output, then it worked.

The only executables you need to start is "teeworlds" and/or "teeworlds_srv". If you want to start "teeworlds_srv", do it from a terminal, rather than clicking it in the graphical environment.

8

Re: help compiling, totally lost

Thanks for your help Kottizen and others.
Can you tell me what commands I need to use to run files through tileset_borderfix and dilate? Dragging and dropping them isn't working properly for me (doesn't do anything in Nautilus, gives incorrect results in Thunar unless I'm missing something about what's expected from the base file, and those 2 are what I've got installed).

9

Re: help compiling, totally lost

Alright, as I suspected my question was a newb one, but I am a linux newb so go figure...

To anyone in the future that stumbles across this issue: to run tileset_borderfix and dilate when your linux file manager doesn't have a drag on drop feature, just go to the command line, browse to the folder that that has both the utility file and the file you want to modify, and do:

./tileset_borderfix filename.png

making sure you've backed up first, since it will write over that png.
being a linux newbie, I didn't know that to execute the program I had to have the " ./ " there.

10

Re: help compiling, totally lost

Little sidenote here; if you are in the same folder as the program you want to execute is in, you will have to use "./" before. Othwise, just type the path, like "/home/user/teeworlds".