Page 1 of 1

Compiling Spasm from SVN

PostPosted: 19 January 2014, 19:21
by add
Hello, I'd like to start learning z80 (TI84+ more specifically) programming (again..), and I've downloaded the Spasm code from the link to svn on wabbit.
But to no avail, I got this error message:
Code: Select all
$ make
g++ -I.  -DUSE_REUSABLES -DUSE_GMP -DUNIXVER -DUSE_BUILTIN_FCREATE -c main.cpp
In file included from storage.h:5:0,
                 from main.cpp:7:
hash.h:29:31: error: expected template-name before ‘<’ token
hash.h:29:31: error: expected ‘{’ before ‘<’ token
hash.h:29:31: error: expected unqualified-id before ‘<’ token                          
make: *** [main.o] Error 1
 

Re: Compiling Spasm from SVN

PostPosted: 19 January 2014, 19:36
by chickendude
You'll need to add #include <functional> and #include <unordered_map> at the top (under #include "list.h").
You'll also need to add the flag:
-std=c++11
..to g++ in the makefile:
CXXFLAGS+= -I. -DUSE_REUSABLES -DUSE_GMP -DUNIXVER -DUSE_BUILTIN_FCREATE -std=c++11

There might be a couple other issues as well, i think there are a couple #if statements you'll need to modify. Try downloading the modified source that Contra put together and seeing if that works:
http://www.mirari.fr/wo0H

Re: Compiling Spasm from SVN

PostPosted: 19 January 2014, 21:47
by add
Works well! Thanks.

EDIT: I actually tried "make clean" and then "make" and then it errors again, woot..

EDIT2: I changed -std=c++11 to -std=c++0x and it compiled..

Re: Compiling Spasm from SVN

PostPosted: 20 January 2014, 02:00
by chickendude
Ah, cool, i guess you have an older version of g++. Glad to hear it worked, though! Have you tried assembling anything, yet?

Re: Compiling Spasm from SVN

PostPosted: 20 January 2014, 10:14
by add
No, I should get some example programs for a starter I guess.
And yeah my gcc is an older version, the standard version that comes with ubuntu 12.04 :-/