CruiserOne / Daedalus

The Maze generation software "Daedalus", version 3.4
http://www.astrolog.org/labyrnth/daedalus.htm
Other
53 stars 7 forks source link

Building on Ubuntu fails on `color.o` #1

Closed stupid-genius closed 4 years ago

stupid-genius commented 4 years ago

Building on Ubuntu 18.04 after commenting out #define WIN in util.h, using the following makefile

  1 NAME = daedalus
  2 OBJ = color.o command.o create.o create2.o create3.o daedalus.o draw.o draw2.o game.o graphics.o inside.o labyrnth.o maze.o solids.o solve.o threed.o util.o
  3 LIBS = -lm
  4 CPPFLAGS = -O -Wno-write-strings -Wno-narrowing -Wno-comment
  5 daedalus:: $(OBJ)
  6     g++ -o $(NAME) $(OBJ) $(LIBS)
  7     strip $(NAME)

make returns many notes and errors. Beginning and end of output below.

g++  -O -Wno-write-strings -Wno-narrowing -Wno-comment  -c -o color.o color.cpp
In file included from color.cpp:33:0:
util.h:228:26: error: expected initializer before ‘qword’
 typedef unsigned __int64 qword;
                          ^~~~~
util.h:232:26: error: expected initializer before ‘uquad’
 typedef unsigned __int64 uquad;
                          ^~~~~
util.h:235:9: error: ‘__int64’ does not name a type; did you mean ‘__rintf64’?
 typedef __int64 quad;
         ^~~~~~~
         __rintf64

...

util.h:54:17: error: ‘sprintf_s’ was not declared in this scope
 #define sprintf sprintf_s
                 ^
color.cpp:2805:3: note: in expansion of macro ‘sprintf’
   sprintf(SS(sz, cch), "rgb %d %d %d", RgbR(kv), RgbG(kv), RgbB(kv));
   ^~~~~~~
util.h:54:17: note: suggested alternative: ‘sprintf’
 #define sprintf sprintf_s
                 ^
color.cpp:2805:3: note: in expansion of macro ‘sprintf’
   sprintf(SS(sz, cch), "rgb %d %d %d", RgbR(kv), RgbG(kv), RgbB(kv));
   ^~~~~~~
color.cpp: In function ‘KV ParseColorCore(char**, flag)’:
util.h:55:16: error: ‘sscanf_s’ was not declared in this scope
 #define sscanf sscanf_s
                ^
color.cpp:2820:3: note: in expansion of macro ‘sscanf’
   sscanf(*ppch, "%s", S(line));
   ^~~~~~
util.h:55:16: note: suggested alternative: ‘sscanf’
 #define sscanf sscanf_s
                ^
color.cpp:2820:3: note: in expansion of macro ‘sscanf’
   sscanf(*ppch, "%s", S(line));
   ^~~~~~
<builtin>: recipe for target 'color.o' failed
make: *** [color.o] Error 1
CruiserOne commented 4 years ago

If you're compiling on Linux, then you should also comment out "#define PC". That will avoid using the Microsoft Visual Studio compiler specific string functions that end in "_s", that your compiler doesn't have access to.

stupid-genius commented 4 years ago

Success! Thanks!