Build error and source adaption on a port

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
User avatar
Raziel
ScummVM Porter
Posts: 1522
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Build error and source adaption on a port

Post by Raziel »

Hi aquadran,

as there is (still) ;-) no bug tracker for ResidualVM and me not able to be in IRC frequently i'll post the build error i get (since a few weeks now) on the forums instead. I hope this is OK?

I don't know if this is a "bug" in ResidualVM or the port of LUA from my platform (either way i need to fix it to get ResidualVM to build again).

Here is the line:
g++ -Wp,-MMD,"engines/grim/lua/.deps/lstate.d",-MQ,"engines/grim/lua/lstate.o",-MP -Wall -g -mcrt=newlib -mstrict-align -mcpu=750 -mtune=7400 -W -Wno-unused-parameter -Wconversion -pedantic -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder -Wno-unused-parameter -DRESIDUAL_SVN_REVISION=\"1433\" -DHAVE_CONFIG_H -DMINIGL -DUSE_OPENGL -DDATA_PATH=\"/usr/local/share/residual\" -DPLUGIN_DIRECTORY=\"/usr/local/lib/residual\" -DSDL_BACKEND -DENABLE_GRIM=STATIC_PLUGIN -I. -I. -I/SDK/Local/newlib/include/SDL -D_GNU_SOURCE=1 -c engines/grim/lua/lstate.cpp -o engines/grim/lua/lstate.o
engines/grim/lua/lstate.cpp: In function 'void Grim::lua_open()':
engines/grim/lua/lstate.cpp:144: error: invalid conversion from 'void (*)(Grim::lua_Function, const char*, int)' to 'void (*)(Grim::lua_Function, const char*, int32)'
gmake: *** [engines/grim/lua/lstate.o] Error 1

The line 144 from engines/grim/lua/lstate.cpp would be:

135 void lua_open() {
136 if (lua_state)
137 return;
138 lua_state = luaM_new(LState);
139 lua_resetglobals();
140 luaT_init();
141 luaB_predefine();
142 luaL_addlibtolist(stdErrorRimFunc, (sizeof(stdErrorRimFunc) / sizeof(stdErrorRimFunc[0])));
143 if (gDebugLevel == DEBUG_LUA || gDebugLevel == DEBUG_ALL)
144 lua_callhook = callHook;
145 }

so i'm wondering if there is anything i could do to fix (or workaround) it.

Also i need you to do two more changes (small ones) to ports.mk
lines 190 and 191 in ports.mk should look like this:
cp $(srcdir)/COPYING.LGPL $(AOS4PATH)/COPYING.LGPL.txt
cp $(srcdir)/COPYING.GPL $(AOS4PATH)/COPYING.GPL.txt
instead of
cp $(srcdir)/COPYING.LGPL $(AOS4PATH)/COPYING_LGPL.txt
cp $(srcdir)/COPYING.GPL $(AOS4PATH)/COPYING_GPL.txt
(underlines replaced with the original periods in the port installment)

Reason is, i don't want to obfuscate the original file names too much

Thank you very much
aquadran
ScummVM Developer
Posts: 110
Joined: Wed Sep 21, 2005 7:00 pm

Post by aquadran »

done, please check
User avatar
Raziel
ScummVM Porter
Posts: 1522
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Post by Raziel »

Error gone, but a new one popped up...

g++ -Wp,-MMD,"engines/grim/.deps/grim.d",-MQ,"engines/grim/grim.o",-MP -Wall -g -mcrt=newlib -mstrict-align -mcpu=750 -mtune=7400 -W -Wno-unused-parameter -Wconversion -pedantic -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder -Wno-unused-parameter -DRESIDUAL_SVN_REVISION=\"1435\" -DHAVE_CONFIG_H -DMINIGL -DUSE_OPENGL -DDATA_PATH=\"/usr/local/share/residual\" -DPLUGIN_DIRECTORY=\"/usr/local/lib/residual\" -DSDL_BACKEND -DENABLE_GRIM=STATIC_PLUGIN -I. -I. -I/SDK/Local/newlib/include/SDL -D_GNU_SOURCE=1 -c engines/grim/grim.cpp -o engines/grim/grim.o
In file included from /SDK/include/include_h/intuition/intuition.h:45,
from /SDK/local/common/include/mgl/context.h:27,
from /SDK/local/common/include/mgl/gl.h:72,
from /SDK/local/common/include/GL/gl.h:1915,
from /SDK/Local/newlib/include/SDL/SDL_opengl.h:44,
from ./engines/grim/gfx_opengl.h:34,
from engines/grim/grim.cpp:40:
/SDK/include/include_h/devices/inputevent.h:122: error: declaration of 'WORD IEPointerPixel::<anonymous struct>::v [1]'
/SDK/include/include_h/devices/inputevent.h:121: error: conflicts with previous declaration 'WORD IEPointerPixel::<anonymous struct>::v [0]'
/SDK/include/include_h/devices/inputevent.h:143: error: declaration of 'UWORD IEPointerTablet::<anonymous struct>::v [1]'
/SDK/include/include_h/devices/inputevent.h:142: error: conflicts with previous declaration 'UWORD IEPointerTablet::<anonymous struct>::v [0]'
/SDK/include/include_h/devices/inputevent.h:148: error: declaration of 'UWORD IEPointerTablet::<anonymous struct>::v [1]'
/SDK/include/include_h/devices/inputevent.h:147: error: conflicts with previous declaration 'UWORD IEPointerTablet::<anonymous struct>::v [0]'
In file included from /SDK/include/include_h/intuition/intuition.h:1636,
from /SDK/local/common/include/mgl/context.h:27,
from /SDK/local/common/include/mgl/gl.h:72,
from /SDK/local/common/include/GL/gl.h:1915,
from /SDK/Local/newlib/include/SDL/SDL_opengl.h:44,
from ./engines/grim/gfx_opengl.h:34,
from engines/grim/grim.cpp:40:
/SDK/include/include_h/intuition/screens.h:98: error: declaration of 'UWORD DrawInfo::<anonymous struct>::v [1]'
/SDK/include/include_h/intuition/screens.h:97: error: conflicts with previous declaration 'UWORD DrawInfo::<anonymous struct>::v [0]'
In file included from /SDK/local/common/include/mgl/gl.h:349,
from /SDK/local/common/include/GL/gl.h:1915,
from /SDK/Local/newlib/include/SDL/SDL_opengl.h:44,
from ./engines/grim/gfx_opengl.h:34,
from engines/grim/grim.cpp:40:
/SDK/local/common/include/mgl/minigl.h: In function 'void gluTessNormal(GLUtesselator*, GLdouble*, GLdouble*, GLdouble*)':
/SDK/local/common/include/mgl/minigl.h:1656: error: redeclaration of 'GLdouble* v'
/SDK/local/common/include/mgl/minigl.h:1656: error: 'GLdouble* v' previously declared here
/SDK/local/common/include/mgl/minigl.h:1656: error: redeclaration of 'GLdouble* v'
/SDK/local/common/include/mgl/minigl.h:1656: error: 'GLdouble* v' previously declared here
gmake: *** [engines/grim/grim.o] Error 1
aquadran
ScummVM Developer
Posts: 110
Joined: Wed Sep 21, 2005 7:00 pm

Post by aquadran »

it looks like multiple inclusion of some includes
aquadran
ScummVM Developer
Posts: 110
Joined: Wed Sep 21, 2005 7:00 pm

Post by aquadran »

do you cross compiling ?
User avatar
Raziel
ScummVM Porter
Posts: 1522
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Post by Raziel »

nope, building on an AmigaOS4 machine for AmigaOS4
User avatar
Raziel
ScummVM Porter
Posts: 1522
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Post by Raziel »

Since the sync i get another build error (not that i managed to fix the old one, heh)

C++ backends/platform/sdl/events.o
In file included from ./common/events.h:29,
from ./backends/events/default/default-events.h:29,
from ./backends/base-backend.h:30,
from ./backends/platform/sdl/sdl.h:38,
from backends/platform/sdl/events.cpp:26:
./common/keyboard.h:69: error: expected identifier before numeric constant
./common/keyboard.h:69: error: expected `}' before numeric constant
./common/keyboard.h:69: error: expected unqualified-id before numeric constant
./common/keyboard.h:182: error: extra ';'
./common/keyboard.h:235: error: 'KeyCode' does not name a type
./common/keyboard.h:252: error: expected `)' before 'kc'
./common/keyboard.h:258: error: expected `)' before 'kc'
./common/keyboard.h: In member function 'void KeyState::reset()':
./common/keyboard.h:265: error: 'keycode' was not declared in this scope
./common/keyboard.h:265: error: 'KEYCODE_INVALID' was not declared in this scope
./common/keyboard.h: In member function 'bool KeyState::operator==(const KeyState&) const':
./common/keyboard.h:270: error: 'keycode' was not declared in this scope
./common/keyboard.h:270: error: 'const struct KeyState' has no member named 'keycode'
./common/keyboard.h: At global scope:
./common/keyboard.h:274: error: expected declaration before '}' token
gmake: *** [backends/platform/sdl/events.o] Error 1
aquadran
ScummVM Developer
Posts: 110
Joined: Wed Sep 21, 2005 7:00 pm

Post by aquadran »

I wonder why you got errors, since code is from scummvm, maybe in your case, there is missing some include.
User avatar
Raziel
ScummVM Porter
Posts: 1522
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Post by Raziel »

Hi aquadran,

the latest error i was able to solve, but due to me being no coder i was only able to workaround, a fix would be to #ifdef, but i don't know how, sorry :-(

There are defines of
KEYCODE_LESS = 60,
and
KEYCODE_GREATER = 62,
which are both already defined in SDK:include/include_h/intuition/ intuition.h on AmigaOS4

A workaround for me is to comment out those two lines in common/keyboard.h, lines 69 and 71, but of course this will break other ports.
User avatar
Raziel
ScummVM Porter
Posts: 1522
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Post by Raziel »

The other one i still get, but it also looks like a doubled define, unfortunately i have no idea where to look for those, the other one was an easy grep, but this is a function, if i see it right?

Any help appreciated


C++ engines/grim/grim.o
In file included from ./common/stream.h:30,
from ./common/file.h:32,
from engines/grim/grim.cpp:34:
./common/endian.h: In function 'float get_float(const char*)':
./common/endian.h:421: warning: cast from 'unsigned char*' to 'const float*' increases required alignment of target type
In file included from /SDK/include/include_h/intuition/intuition.h:45,
from /SDK/local/common/include/mgl/context.h:27,
from /SDK/local/common/include/mgl/gl.h:72,
from /SDK/local/common/include/GL/gl.h:1915,
from /SDK/Local/newlib/include/SDL/SDL_opengl.h:44,
from ./engines/grim/gfx_opengl.h:34,
from engines/grim/grim.cpp:48:
/SDK/include/include_h/devices/inputevent.h: At global scope:
/SDK/include/include_h/devices/inputevent.h:122: error: declaration of 'WORD IEPointerPixel::<anonymous struct>::v [1]'
/SDK/include/include_h/devices/inputevent.h:121: error: conflicts with previous declaration 'WORD IEPointerPixel::<anonymous struct>::v [0]'
/SDK/include/include_h/devices/inputevent.h:143: error: declaration of 'UWORD IEPointerTablet::<anonymous struct>::v [1]'
/SDK/include/include_h/devices/inputevent.h:142: error: conflicts with previous declaration 'UWORD IEPointerTablet::<anonymous struct>::v [0]'
/SDK/include/include_h/devices/inputevent.h:148: error: declaration of 'UWORD IEPointerTablet::<anonymous struct>::v [1]'
/SDK/include/include_h/devices/inputevent.h:147: error: conflicts with previous declaration 'UWORD IEPointerTablet::<anonymous struct>::v [0]'
In file included from /SDK/include/include_h/intuition/intuition.h:1636,
from /SDK/local/common/include/mgl/context.h:27,
from /SDK/local/common/include/mgl/gl.h:72,
from /SDK/local/common/include/GL/gl.h:1915,
from /SDK/Local/newlib/include/SDL/SDL_opengl.h:44,
from ./engines/grim/gfx_opengl.h:34,
from engines/grim/grim.cpp:48:
/SDK/include/include_h/intuition/screens.h:98: error: declaration of 'UWORD DrawInfo::<anonymous struct>::v [1]'
/SDK/include/include_h/intuition/screens.h:97: error: conflicts with previous declaration 'UWORD DrawInfo::<anonymous struct>::v [0]'
In file included from /SDK/local/common/include/mgl/gl.h:349,
from /SDK/local/common/include/GL/gl.h:1915,
from /SDK/Local/newlib/include/SDL/SDL_opengl.h:44,
from ./engines/grim/gfx_opengl.h:34,
from engines/grim/grim.cpp:48:
/SDK/local/common/include/mgl/minigl.h: In function 'void gluTessNormal(GLUtesselator*, GLdouble*, GLdouble*, GLdouble*)':
/SDK/local/common/include/mgl/minigl.h:1656: error: redeclaration of 'GLdouble* v'
/SDK/local/common/include/mgl/minigl.h:1656: error: 'GLdouble* v' previously declared here
/SDK/local/common/include/mgl/minigl.h:1656: error: redeclaration of 'GLdouble* v'
/SDK/local/common/include/mgl/minigl.h:1656: error: 'GLdouble* v' previously declared here
gmake: *** [engines/grim/grim.o] Error 1
frakswe
Posts: 2
Joined: Mon Feb 13, 2017 6:54 pm
Location: Sweden

Post by frakswe »

mixing minigl and sdl when compiling residual seems to confuse the os4 SDK for some reason.. i had to remove the -Dminigl and -Dwith_gl (something like that iirc) in the config.mk file, but then later on the lua stuff is also "wrong" , int32 has been defined as "long long", but it's defined as "int" somewhere else (in some header files iirc) ....

anyway, i got it to build eventually, but running it,i got some "assert error" line 90 bla bla.

at that point it stopped beeing fun.
User avatar
Raziel
ScummVM Porter
Posts: 1522
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Post by Raziel »

Hi frak :-)

it seems we need to wait some more until this soft gets some momentum.
All the devs are dancing at the ScummVM party right now ;-)
Post Reply