1

Topic: Compiling TW problem

Hello i have problem can you help me?

Windows 7 Ultimate 64bit
http://www.visualstudio.com/downloads/d … Families_4 i use this  visual studio
Python 3.2.1
bam 0.4.0
teeworlds 0.6.1

configuration

i am getting this

ing ',' before '*'
c:\tws\src\game\client\components/items.h(26) : error C2061: syntax error : iden
tifier 'CNetObj_Projectile'
c:\tws\src\game\client\components/players.h(12) : error C4430: missing type spec
ifier - int assumed. Note: C++ does not support default-int
c:\tws\src\game\client\components/players.h(12) : error C2143: syntax error : mi
ssing ',' before '*'
c:\tws\src\game\client\components/players.h(19) : error C4430: missing type spec
ifier - int assumed. Note: C++ does not support default-int
c:\tws\src\game\client\components/players.h(19) : error C2143: syntax error : mi
ssing ',' before '*'
c:\tws\src\game\client\components/nameplates.h(10) : error C4430: missing type s
pecifier - int assumed. Note: C++ does not support default-int
c:\tws\src\game\client\components/nameplates.h(10) : error C2143: syntax error :
 missing ',' before '*'
src/game/client/gameclient.cpp(89) : error C2146: syntax error : missing ';' bef
ore identifier 'GAME_NETVERSION_HASH'
src/game/client/gameclient.cpp(89) : error C2065: 'GAME_NETVERSION_HASH' : undec
lared identifier
src/game/client/gameclient.cpp(90) : error C2065: 'm_NetObjHandler' : undeclared
 identifier
src/game/client/gameclient.cpp(90) : error C2228: left of '.GetObjName' must hav
e class/struct/union
        type is ''unknown-type''
src/game/client/gameclient.cpp(96) : error C2065: 'TEAM_RED' : undeclared identi
fier
src/game/client/gameclient.cpp(98) : error C2065: 'TEAM_BLUE' : undeclared ident
ifier
src/game/client/gameclient.cpp(126) : error C2065: 'NUM_GAMEMSGS' : undeclared i
dentifier
src/game/client/gameclient.cpp(128) : error C2078: too many initializers
src/game/client/gameclient.cpp(129) : fatal error C1903: unable to recover from
previous error(s); stopping compilation
bam: 'objs/game/client/gameclient.obj' error 2
[127/160] #1 c++ src/game/client/lineinput.cpp
[128/160] #1 c++ src/game/client/localization.cpp
[129/160] #1 c++ src/game/client/render.cpp
c:\tws\src\game\client\animstate.h(8) : error C2146: syntax error : missing ';'
before identifier 'm_Body'
c:\tws\src\game\client\animstate.h(8) : error C4430: missing type specifier - in
t assumed. Note: C++ does not support default-int
c:\tws\src\game\client\animstate.h(8) : error C4430: missing type specifier - in
t assumed. Note: C++ does not support default-int
c:\tws\src\game\client\animstate.h(9) : error C2146: syntax error : missing ';'
before identifier 'm_BackFoot'
c:\tws\src\game\client\animstate.h(9) : error C4430: missing type specifier - in
t assumed. Note: C++ does not support default-int
c:\tws\src\game\client\animstate.h(9) : error C4430: missing type specifier - in
t assumed. Note: C++ does not support default-int
c:\tws\src\game\client\animstate.h(10) : error C2146: syntax error : missing ';'
 before identifier 'm_FrontFoot'
c:\tws\src\game\client\animstate.h(10) : error C4430: missing type specifier - i
nt assumed. Note: C++ does not support default-int
c:\tws\src\game\client\animstate.h(10) : error C4430: missing type specifier - i
nt assumed. Note: C++ does not support default-int
c:\tws\src\game\client\animstate.h(11) : error C2146: syntax error : missing ';'
 before identifier 'm_Attach'
c:\tws\src\game\client\animstate.h(11) : error C4430: missing type specifier - i
nt assumed. Note: C++ does not support default-int
c:\tws\src\game\client\animstate.h(11) : error C4430: missing type specifier - i
nt assumed. Note: C++ does not support default-int
c:\tws\src\game\client\animstate.h(14) : error C2143: syntax error : missing ';'
 before '*'
c:\tws\src\game\client\animstate.h(14) : error C4430: missing type specifier - i
nt assumed. Note: C++ does not support default-int
c:\tws\src\game\client\animstate.h(14) : error C4430: missing type specifier - i
nt assumed. Note: C++ does not support default-int
c:\tws\src\game\client\animstate.h(14) : warning C4183: 'GetBody': missing retur
n type; assumed to be a member function returning 'int'
c:\tws\src\game\client\animstate.h(15) : error C2143: syntax error : missing ';'
 before '*'
c:\tws\src\game\client\animstate.h(15) : error C4430: missing type specifier - i
nt assumed. Note: C++ does not support default-int
c:\tws\src\game\client\animstate.h(15) : error C4430: missing type specifier - i
nt assumed. Note: C++ does not support default-int
c:\tws\src\game\client\animstate.h(15) : warning C4183: 'GetBackFoot': missing r
eturn type; assumed to be a member function returning 'int'
c:\tws\src\game\client\animstate.h(16) : error C2143: syntax error : missing ';'
 before '*'
c:\tws\src\game\client\animstate.h(16) : error C4430: missing type specifier - i
nt assumed. Note: C++ does not support default-int
c:\tws\src\game\client\animstate.h(16) : error C4430: missing type specifier - i
nt assumed. Note: C++ does not support default-int
c:\tws\src\game\client\animstate.h(16) : warning C4183: 'GetFrontFoot': missing
return type; assumed to be a member function returning 'int'
c:\tws\src\game\client\animstate.h(17) : error C2143: syntax error : missing ';'
 before '*'
c:\tws\src\game\client\animstate.h(17) : error C4430: missing type specifier - i
nt assumed. Note: C++ does not support default-int
c:\tws\src\game\client\animstate.h(17) : error C4430: missing type specifier - i
nt assumed. Note: C++ does not support default-int
c:\tws\src\game\client\animstate.h(17) : warning C4183: 'GetAttach': missing ret
urn type; assumed to be a member function returning 'int'
c:\tws\src\game\client\animstate.h(18) : error C2061: syntax error : identifier
'CAnimation'
c:\tws\src\game\client\animstate.h(19) : error C2061: syntax error : identifier
'CAnimation'
c:\tws\src\game\client\animstate.h(14) : error C2065: 'm_Body' : undeclared iden
tifier
c:\tws\src\game\client\animstate.h(15) : error C2065: 'm_BackFoot' : undeclared
identifier
c:\tws\src\game\client\animstate.h(16) : error C2065: 'm_FrontFoot' : undeclared
 identifier
c:\tws\src\game\client\animstate.h(17) : error C2065: 'm_Attach' : undeclared id
entifier
src/game/client/render.cpp(42) : error C2027: use of undefined type 'CDataSprite
'
        c:\tws\src\game\client\render.h(53) : see declaration of 'CDataSprite'
src/game/client/render.cpp(42) : error C2227: left of '->m_X' must point to clas
s/struct/union/generic type
src/game/client/render.cpp(43) : error C2027: use of undefined type 'CDataSprite
'
        c:\tws\src\game\client\render.h(53) : see declaration of 'CDataSprite'
src/game/client/render.cpp(43) : error C2227: left of '->m_Y' must point to clas
s/struct/union/generic type
src/game/client/render.cpp(44) : error C2027: use of undefined type 'CDataSprite
'
        c:\tws\src\game\client\render.h(53) : see declaration of 'CDataSprite'
src/game/client/render.cpp(44) : error C2227: left of '->m_W' must point to clas
s/struct/union/generic type
src/game/client/render.cpp(45) : error C2027: use of undefined type 'CDataSprite
'
        c:\tws\src\game\client\render.h(53) : see declaration of 'CDataSprite'
src/game/client/render.cpp(45) : error C2227: left of '->m_H' must point to clas
s/struct/union/generic type
src/game/client/render.cpp(46) : error C2027: use of undefined type 'CDataSprite
'
        c:\tws\src\game\client\render.h(53) : see declaration of 'CDataSprite'
src/game/client/render.cpp(46) : error C2227: left of '->m_pSet' must point to c
lass/struct/union/generic type
src/game/client/render.cpp(46) : error C2227: left of '->m_Gridx' must point to
class/struct/union/generic type
src/game/client/render.cpp(47) : error C2027: use of undefined type 'CDataSprite
'
        c:\tws\src\game\client\render.h(53) : see declaration of 'CDataSprite'
src/game/client/render.cpp(47) : error C2227: left of '->m_pSet' must point to c
lass/struct/union/generic type
src/game/client/render.cpp(47) : error C2227: left of '->m_Gridy' must point to
class/struct/union/generic type
src/game/client/render.cpp(78) : error C2065: 'g_pData' : undeclared identifier
src/game/client/render.cpp(78) : error C2227: left of '->m_NumSprites' must poin
t to class/struct/union/generic type
        type is ''unknown-type''
src/game/client/render.cpp(80) : error C2065: 'g_pData' : undeclared identifier
src/game/client/render.cpp(80) : error C2227: left of '->m_aSprites' must point
to class/struct/union/generic type
        type is ''unknown-type''
src/game/client/render.cpp(373) : error C2227: left of '->m_X' must point to cla
ss/struct/union/generic type
        type is 'int *'
src/game/client/render.cpp(373) : error C2227: left of '->m_Y' must point to cla
ss/struct/union/generic type
        type is 'int *'
src/game/client/render.cpp(382) : error C2227: left of '->m_Angle' must point to
 class/struct/union/generic type
        type is 'int *'
src/game/client/render.cpp(384) : error C2065: 'SPRITE_TEE_DECORATION_OUTLINE' :
 undeclared identifier
src/game/client/render.cpp(384) : error C2065: 'SPRITE_TEE_DECORATION' : undecla
red identifier
src/game/client/render.cpp(393) : error C2227: left of '->m_Angle' must point to
 class/struct/union/generic type
        type is 'int *'
src/game/client/render.cpp(397) : error C2065: 'SPRITE_TEE_BODY_OUTLINE' : undec
lared identifier
src/game/client/render.cpp(402) : error C2065: 'SPRITE_TEE_BODY' : undeclared id
entifier
src/game/client/render.cpp(413) : error C2227: left of '->m_Angle' must point to
 class/struct/union/generic type
        type is 'int *'
src/game/client/render.cpp(415) : error C2065: 'SPRITE_TEE_TATTOO' : undeclared
identifier
src/game/client/render.cpp(426) : error C2227: left of '->m_Angle' must point to
 class/struct/union/generic type
        type is 'int *'
src/game/client/render.cpp(430) : error C2065: 'SPRITE_TEE_BODY_SHADOW' : undecl
ared identifier
src/game/client/render.cpp(430) : error C2065: 'SPRITE_TEE_BODY_UPPER_OUTLINE' :
 undeclared identifier
src/game/client/render.cpp(440) : error C2227: left of '->m_Angle' must point to
 class/struct/union/generic type
        type is 'int *'
src/game/client/render.cpp(446) : error C2065: 'EMOTE_PAIN' : undeclared identif
ier
src/game/client/render.cpp(446) : error C2051: case expression not constant
src/game/client/render.cpp(447) : error C2065: 'SPRITE_TEE_EYES_PAIN' : undeclar
ed identifier
src/game/client/render.cpp(449) : error C2065: 'EMOTE_HAPPY' : undeclared identi
fier
src/game/client/render.cpp(449) : error C2051: case expression not constant
src/game/client/render.cpp(450) : error C2065: 'SPRITE_TEE_EYES_HAPPY' : undecla
red identifier
src/game/client/render.cpp(452) : error C2065: 'EMOTE_SURPRISE' : undeclared ide
ntifier
src/game/client/render.cpp(452) : error C2051: case expression not constant
src/game/client/render.cpp(453) : error C2065: 'SPRITE_TEE_EYES_SURPRISE' : unde
clared identifier
src/game/client/render.cpp(455) : error C2065: 'EMOTE_ANGRY' : undeclared identi
fier
src/game/client/render.cpp(455) : error C2051: case expression not constant
src/game/client/render.cpp(456) : error C2065: 'SPRITE_TEE_EYES_ANGRY' : undecla
red identifier
src/game/client/render.cpp(459) : error C2065: 'SPRITE_TEE_EYES_NORMAL' : undecl
ared identifier
src/game/client/render.cpp(464) : error C2065: 'EMOTE_BLINK' : undeclared identi
fier
src/game/client/render.cpp(475) : error C2065: 'CAnimKeyframe' : undeclared iden
tifier
src/game/client/render.cpp(475) : error C2065: 'pFoot' : undeclared identifier
src/game/client/render.cpp(480) : error C2065: 'pFoot' : undeclared identifier
src/game/client/render.cpp(480) : error C2227: left of '->m_Angle' must point to
 class/struct/union/generic type
        type is ''unknown-type''
src/game/client/render.cpp(485) : error C2065: 'SPRITE_TEE_FOOT_OUTLINE' : undec
lared identifier
src/game/client/render.cpp(494) : error C2065: 'SPRITE_TEE_FOOT' : undeclared id
entifier
src/game/client/render.cpp(497) : error C2065: 'pFoot' : undeclared identifier
src/game/client/render.cpp(497) : error C2227: left of '->m_X' must point to cla
ss/struct/union/generic type
        type is ''unknown-type''
src/game/client/render.cpp(497) : error C2065: 'pFoot' : undeclared identifier
src/game/client/render.cpp(497) : error C2227: left of '->m_Y' must point to cla
ss/struct/union/generic type
        type is ''unknown-type''
bam: 'objs/game/client/render.obj' error 2
[130/160] #1 c++ src/game/client/render_map.cpp
[131/160] #1 c++ src/game/client/ui.cpp
[132/160] #1 client_content_source > src/game/generated/client_data.cpp
[133/160] #1 c++ src/game/generated/client_data.cpp
[134/160] #1 c++ src/engine/client/backend_sdl.cpp
[135/160] #1 c++ src/engine/client/client.cpp
[136/160] #1 c++ src/engine/client/friends.cpp
[137/160] #1 c++ src/engine/client/graphics_threaded.cpp
[138/160] #1 c++ src/engine/client/input.cpp
[139/160] #1 c++ src/engine/client/serverbrowser.cpp
[140/160] #1 c++ src/engine/client/sound.cpp
[141/160] #1 c++ src/engine/client/text.cpp
[142/160] #1 c++ src/game/editor/auto_map.cpp
[143/160] #1 c++ src/game/editor/editor.cpp
src\game/gamecore.h(185) : error C2146: syntax error : missing ';' before identi
fier 'm_Input'
src\game/gamecore.h(185) : error C4430: missing type specifier - int assumed. No
te: C++ does not support default-int
src\game/gamecore.h(185) : error C4430: missing type specifier - int assumed. No
te: C++ does not support default-int
src\game/gamecore.h(194) : error C4430: missing type specifier - int assumed. No
te: C++ does not support default-int
src\game/gamecore.h(194) : error C2143: syntax error : missing ',' before '*'
src\game/gamecore.h(195) : error C2061: syntax error : identifier 'CNetObj_Chara
cterCore'
src/game/editor/editor.cpp(2855) : error C2065: 'g_pData' : undeclared identifie
r
src/game/editor/editor.cpp(2855) : error C2227: left of '->m_aImages' must point
 to class/struct/union/generic type
        type is ''unknown-type''
src/game/editor/editor.cpp(2855) : error C2065: 'IMAGE_FILEICONS' : undeclared i
dentifier
src/game/editor/editor.cpp(2855) : error C2228: left of '.m_Id' must have class/
struct/union
src/game/editor/editor.cpp(2857) : error C2065: 'SPRITE_FILE_FOLDER' : undeclare
d identifier
src/game/editor/editor.cpp(2857) : error C2065: 'SPRITE_FILE_MAP2' : undeclared
identifier
c1xx : fatal error C1903: unable to recover from previous error(s); stopping com
pilation
bam: 'objs/game/editor/editor.obj' error 2
[144/160] #1 c++ src/game/editor/io.cpp
src\game/gamecore.h(185) : error C2146: syntax error : missing ';' before identi
fier 'm_Input'
src\game/gamecore.h(185) : error C4430: missing type specifier - int assumed. No
te: C++ does not support default-int
src\game/gamecore.h(185) : error C4430: missing type specifier - int assumed. No
te: C++ does not support default-int
src\game/gamecore.h(194) : error C4430: missing type specifier - int assumed. No
te: C++ does not support default-int
src\game/gamecore.h(194) : error C2143: syntax error : missing ',' before '*'
src\game/gamecore.h(195) : error C2061: syntax error : identifier 'CNetObj_Chara
cterCore'
bam: 'objs/game/editor/io.obj' error 2
[145/160] #1 c++ src/game/editor/layer_game.cpp
[146/160] #1 c++ src/game/editor/layer_quads.cpp
[147/160] #1 c++ src/game/editor/layer_tiles.cpp
[148/160] #1 c++ src/game/editor/popups.cpp
[149/160] #1 c src/engine/external/wavpack/bits.c
[150/160] #1 c src/engine/external/wavpack/float.c
[151/160] #1 c src/engine/external/wavpack/metadata.c
[152/160] #1 c src/engine/external/wavpack/unpack.c
[153/160] #1 c src/engine/external/wavpack/words.c
[154/160] #1 c src/engine/external/wavpack/wputils.c
[155/160] #1 c src/engine/external/json-parser/json.c
[156/160] #1 rc other/icons/teeworlds_cl.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.1.7600.16385
Copyright (C) Microsoft Corporation.  All rights reserved.

[157/160] #1 copy other\freetype\lib32\freetype.dll -> freetype.dll
[158/160] #1 copy other\sdl\lib32\SDL.dll -> SDL.dll
bam: error: a build step failed

what to do? i really want tw compiled


I tried compiling it with mingw compiler but i get that same error.

2

Re: Compiling TW problem

Are you using 32bit bam or 64bit?

Btw, I don't recommend you to use VS 2013, I had some problems too. Use 2010 instead (supports sources of all known tw mods)

3 (edited by Kondensator 2014-08-28 00:40:49)

Re: Compiling TW problem

I use visual studio 2010 maybe link is broken or something. i use this bam https://github.com/downloads/matricks/bam/bam-0.4.0.zip i dont know what version of bam it is cause it is from tutorial of compiling tw.

EDIT: Ehh i am idiot i compiled 32 bit version of bam now i will try with 64 and i will tell results.
EDIT: I tried with 64 bit bam and i have errors again there are everywhere something like that ( i dont know how it is in english but i will translate this smile ) "Name "g++" is not recognizable as internal or external command, executable program or batch file"

4

Re: Compiling TW problem

Probably not correctly installed python.
You can check it by trying to call some python script in the command line
(e.g > cmd5.py)

5

Re: Compiling TW problem

You mean just write cmd5.py in cmd or what?

6

Re: Compiling TW problem

Yes, start some python script via command line
(e.g cmd5.py is located in teeworlds/scripts, you should be able to call it by typing "cmd5.py" in the terminal)

The problem is teeworlds creates some .h/.cpp files during the build process via python.
These files are missing it probably couldn't execute the python scripts.

7

Re: Compiling TW problem

When i do it there opens a window with this:

import hashlib, sys, re

alphanum = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_".encode()

def cstrip(lines):
    d = "".encode()
    for l in lines:
        l = re.sub("#.*".encode(), "".encode(), l)
        l = re.sub("//.*".encode(), "".encode(), l)
        d += l + " ".encode()
    d = re.sub("\/\*.*?\*/".encode(), "".encode(), d) # remove /* */ comments
    d = d.replace("\t".encode(), " ".encode()) # tab to space
    d = re.sub("  *".encode(), " ".encode(), d) # remove double spaces
    d = re.sub("".encode(), "".encode(), d) # remove /* */ comments

    d = d.strip()

    # this eats up cases like 'n {'
    i = 1
    while i < len(d)-2:
        if d[i:i + 1] == " ".encode():
            if not (d[i - 1:i] in alphanum and d[i+1:i + 2] in alphanum):
                d = d[:i] + d[i + 1:]
        i += 1
    return d

f = "".encode()
for filename in sys.argv[1:]:
    f += cstrip([l.strip() for l in open(filename, "rb")])

hash = hashlib.md5(f).hexdigest().lower()[16:]
#TODO 0.7: improve nethash creation
print('#define GAME_NETVERSION_HASH "%s"' % hash)

8 (edited by BeaR 2014-08-29 12:38:42)

Re: Compiling TW problem

You need to associate the *.py files with python.exe.
("Open with.." and selecting python.exe as default program should be enough)

edit: delete src/game/generated before so the generated files will be rebuild

9 (edited by Kondensator 2014-08-29 13:54:53)

Re: Compiling TW problem

I did it but bam don't want to make new c/cpp/h files. I think it is something bad with python i will reinstall it.

Edit: cmd is it bad?

10

Re: Compiling TW problem

Looks fine.
Be sure to remove all the generated files first before building. Also call 'bam -c all' to remove all old obj files and delete the config.lua. Should build then correctly.

11 (edited by Kondensator 2014-08-29 17:19:25)

Re: Compiling TW problem

bam: error: build step failed <--- all the time sad Maybe you have skype or something that allows me to share my screen and then it will be easier i think.

12

Re: Compiling TW problem

Do you have 2 python versions installed?

How to database by FFanta: http://puu.sh/jdPVk/fa37a95ac2.png

13

Re: Compiling TW problem

No i have only Python 3.2.1