Back to the Vavoom Forum Archives


Forum

Sun, 08 Dec 2002 09:44:30

Duke42

I put FreeBSD 4.7 on my Laptop and Vavoom won't compile. More specific: it doesn't link. I get tons and tons of "unresolved symbols"... It begins with:<br><br>obj/cl_demo.o: In function `CL_GetMessage(void)':<br>obj/cl_demo.o(.text+0x9eb): undefined reference to `Sys_Error(char const *,...)'<br>obj/cl_demo.o: In function `TCmdRecord::Run(void)':<br>obj/cl_demo.o(.text+0x1333): undefined reference to `Sys_CreateDirectory(char const *)'<br>obj/cl_main.o: In function `CL_KeepaliveMessage(void)':<br>obj/cl_main.o(.text+0x13d1): undefined reference to `Sys_Time(void)'<br>...<br><br>where do these come from normally? And goes on with:<br><br>obj/d_aclip.o: In function `D_AliasClipTriangle(mtriangle_t *)':<br>obj/d_aclip.o(.text+0x7d3): undefined reference to `D_Alias_clip_left'<br>obj/d_aclip.o(.text+0x9be): undefined reference to `D_Alias_clip_right'<br>obj/d_aclip.o(.text+0xb7d): undefined reference to `D_Alias_clip_bottom'<br>obj/d_aclip.o(.text+0xd33): undefined reference to `D_Alias_clip_top'<br>obj/d_alias.o: In function `D_AliasPreparePoints(void)':<br>...<br><br>And where should these come from? Then:<br><br>obj/d_edge.o: In function `D_CalcGradients(surface_t *, int, TVec const &)':<br>obj/d_edge.o(.text+0xc7d): undefined reference to `d_zistepu'<br>obj/d_edge.o(.text+0xca9): undefined reference to `d_zistepv'<br>obj/d_edge.o(.text+0xcd0): undefined reference to `d_ziorigin'<br>obj/d_edge.o(.text+0xe08): undefined reference to `d_sdivzstepu'<br>obj/d_edge.o(.text+0xe26): undefined reference to `d_tdivzstepu'<br>...<br><br>and so on, and so on. It seem that it can't find even a single symbol. So, can someone kick me into the right direction?<br><br>thx, Duke42.
Wed, 11 Dec 2002 02:12:26

Janis Legzdinsh

Hmmm. First try to compile a dedicated server with command 'make sv'.<br><br>About functions, Sys_ functions should be in sys_lin.cpp, D_Alias_clip and other variables are in asm files, i.e. d*.s.
Mon, 16 Dec 2002 06:24:44

Duke42

OK, I tried... I actually had to add some files to the OBJs, but I end up with this:<br><br>gmake sv<br>gcc -Wall -s -L/usr/local/lib -L/usr/X11R6/lib -o VavoomSV obj/sv/net_bsd.o obj/sv/net_udp.o obj/sv/cmd.o obj/sv/crc.o obj/sv/cvar.o obj/sv/debug.o obj/sv/files.o obj/sv/host.o obj/sv/infostr.o obj/sv/mapinfo.o obj/sv/maths.o obj/sv/message.o obj/sv/misc.o obj/sv/name.o obj/sv/net_dgrm.o obj/sv/net_loop.o obj/sv/net_main.o obj/sv/net_null.o obj/sv/p_setup.o obj/sv/pr_cmds.o obj/sv/pr_exec.o obj/sv/pr_execa.o obj/sv/r_tex.o obj/sv/s_data.o obj/sv/sc_man.o obj/sv/sizebuf.o obj/sv/sv_acs.o obj/sv/sv_ent.o obj/sv/sv_main.o obj/sv/sv_poly.o obj/sv/sv_save.o obj/sv/sv_sight.o obj/sv/sv_swtch.o obj/sv/sv_tick.o obj/sv/sv_user.o obj/sv/sv_world.o obj/sv/sys_bsd.o obj/sv/vclass.o obj/sv/vobject.o obj/sv/wad.o obj/sv/zone.o obj/sv/level.o -lm -lstdc++<br>obj/sv/pr_execa.o: In function `_RunFunction':<br>obj/sv/pr_execa.o(.text+0xa): undefined reference to `_current_func'<br>obj/sv/pr_execa.o: In function `LINTERPRET_FUNCTION':<br>obj/sv/pr_execa.o(.text+0x22): undefined reference to `_pr_stackPtr'<br>obj/sv/pr_execa.o: In function `LOPC_DONE':<br>obj/sv/pr_execa.o(.text+0x235): undefined reference to `_PR_RFInvalidOpcode'<br>obj/sv/pr_execa.o: In function `LOPC_RETURN':<br>obj/sv/pr_execa.o(.text+0x23e): undefined reference to `_pr_stackPtr'<br>obj/sv/pr_execa.o: In function `LOPC_CALL':<br>obj/sv/pr_execa.o(.text+0x4ca): undefined reference to `_pr_stackPtr'<br>obj/sv/pr_execa.o(.text+0x4e0): undefined reference to `_current_func'<br>obj/sv/pr_execa.o(.text+0x4e6): undefined reference to `_pr_stackPtr'<br>obj/sv/pr_execa.o: In function `LOPC_ICALL':<br>obj/sv/pr_execa.o(.text+0xad3): undefined reference to `_pr_stackPtr'<br>obj/sv/pr_execa.o(.text+0xae4): undefined reference to `_current_func'<br>obj/sv/pr_execa.o(.text+0xaea): undefined reference to `_pr_stackPtr'<br>obj/sv/pr_execa.o: In function `LOPC_RETURNL':<br>obj/sv/pr_execa.o(.text+0xeab): undefined reference to `_pr_stackPtr'<br>obj/sv/pr_execa.o: In function `LOPC_RETURNV':<br>obj/sv/pr_execa.o(.text+0xecb): undefined reference to `_pr_stackPtr'<br>obj/sv/pr_execa.o: In function `LOPC_DYNAMIC_CAST':<br>obj/sv/pr_execa.o(.text+0xf17): undefined reference to `_PR_DynamicCast'<br>gmake: *** [VavoomSV] Error 1<br><br>Now, I don't know where they should come from. It looks to me that e.g. current_func is defined in pr_exec.cpp which is as a library in this link command. So, where do I go from here?<br><br>bye, Adam.
Mon, 16 Dec 2002 16:31:18

Janis Legzdinsh

Maybe your system uses ELF object format (like in Linux). Try to change macro C() in asm_defs.h to use Linux version.
Tue, 17 Dec 2002 00:49:01

Duke42

hooray! That was it! Thank you.... I can now try to compile Vavoom ..<br>One small thing: how do I "define" __linux__, so that I can define "__FreeBSD__" ....?<br><br>Bye, Duke42.
Tue, 17 Dec 2002 01:58:49

Janis Legzdinsh

Write it like this:<br><br>#if defined(__linux__) || defined(__FreeBSD__)<br>
Sat, 18 Jan 2003 23:08:37

Duke42

I know that, I see it in the source code. But where/how do actually define this "linux" ... Is it predefined by the compiler or what?<br><br>Anyway, I'm bad.<br>It turned out that everything was related to my own stupidity. e.g. I tried to do this:<br><br>#-- Linux with Allegro --<br>#      obj/cd_linux.o \<br>SYS_OBJS = \<br>      obj/d_alleg.o \<br><br>but this is bad because of the \ at the end of the commented line. Well, anyways, I managed to compile Vavoom now - though without cd music. <br><br>Just this line, as suggested:<br><br>#if defined(__linux__) || defined(__FreeBSD__)<br>#define C(label)      label            //      ELF format<br>#else<br><br>and a "FreeBSD=1" in the Makefile.<br>OK OK, plus some -I and -L, but I do that all the time <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->.<br><br>This leads me to my next question:<br>I'm playing on a laptop, so I can't afford using too much CPU (it got to 62C last time and the fan is running wild -- and loud). Is it possible to make idle-calls instead busy waiting or whatever Vavoom is doing?<br>Descent (d2src) works with 5-10% CPU load which is very pleasent to play.<br><br>And also one: some time back you talked about gzipping ... as I'm also short on disk space this would be very pleasant.<br><br>thx for Vavoom, duke42.
Sun, 19 Jan 2003 02:40:55

Janis Legzdinsh

The macro __linux__ is defined by compiler. Each compiller defines such macros so programs knows for what they are compilin for.<br><br>ide-calls? Vavoom is not waiting for anything, it uses all of the available time to run game.
Sun, 19 Jan 2003 03:27:56

Duke42

Hmm, so how do I make it less CPU intensive? I mean, if Descent can run with 5-10%, why can't Vavoom?<br>Can I throttle the framerate somehow?<br><br>bye, duke42.
Mon, 20 Jan 2003 20:19:23

Janis Legzdinsh

Sorry, but I really know nothing about such problems.
Tue, 21 Jan 2003 10:35:53

JinnaiGuy

I've never heard of most of this either; but at least it's safe to say that Descent 2 is infinitely older relatively, so it's very likely it doesn't take nearly as much CPU to run it compared to Vavoom.<br><br>I'd say the only chance you'd have is to completely gut the Vavoom core and rewrite it for a higher efficency, which probably means complete termination of all DOOM-esque qualities.
Tue, 21 Jan 2003 16:41:17

Janis Legzdinsh

Maybe they have some maximal framerate and they are doing some sleep when it's higher.
Wed, 22 Jan 2003 04:11:19

Duke42

Sorry, I didn't want to question your work. Vavoom is really great and I love it. I also don't think that you can speed is up this much. It was just that I was asking myself how they (d2x) did this.<br><br>Anyways, I don't want to push this thread any further, just that my gcc doesn't define "__FreeBSD__" nor "__freebsd__", but defines "__ELF__". Perhaps that is better for your ifdef. I don't know if Linux-gcc defines the same, but am highly confidental it does.<br><br>bye, Duke42.<br><br>P.S.: gzipped wads? <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->
Thu, 23 Jan 2003 02:37:49

Janis Legzdinsh

Yeah, that predefined __ELF__ is really usefull. When I'll have time, I'll check this in Linux. AFAIR gcc has a command line option (-v or something like this) that allows you to see what symbols are defined by compiler.
Thu, 23 Jan 2003 14:31:10

JinnaiGuy

FYI, my person Linux RedHat 7.3 webserver's copy of GCC DOES predefine __ELF__.  So its quite possible all Linux distros do indeed predefine __ELF__.
Thu, 23 Jan 2003 16:33:38

Janis Legzdinsh

Cool, that should simplify things.
Tue, 28 Jan 2003 23:43:09

Duke42

Ah, I don't believe I'm still posting into this thread... <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) --><br><br>Anyways, the gcc command-line is:<br> gcc -E -dM - </dev/null<br><br>It said, among other things,<br>#define __FreeBSD__ 5<br>but this didn't work for me. I suspect it's because it's a 5 and not a 1. Perhaps #ifdef only checks for TURE/FALSE.<br>Anyways, __ELF__ is a far better idea in this case.<br><br>Bye, duke42.
Wed, 29 Jan 2003 16:34:49

Janis Legzdinsh

No, that's not that command line that I meant.<br><br>#ifdef checks wether macro is defined, no mather what's the value is. But anyways __ELF__ should be more universal.

Back to the Vavoom Forum Archives