JHGuitarFreak / UQM-MegaMod-Archived

UQM-HD Remastered plus a whole host of extra content and goodies
http://megamod.serosis.net
Other
21 stars 1 forks source link

Building on Linux #1

Closed mike-1-2-3 closed 7 years ago

mike-1-2-3 commented 7 years ago

Any hints on how one might get this running on Linux? I assume this code is supposed to be applied on top of the main source or something, but naively following the instructions in Classic I get:

  LINK     uqm-debug
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'

I mostly just want to remove the overall time limit from the game. Is there a diff (or even just some line of code) I can change from the vanilla code and build from there?

Serosis commented 7 years ago

I haven't tried building in Linux yet.

Which one are you trying to build, HD or Classic?

If it's Classic you have to apply the 0.7.3a-VC10toGCC.diff file to the source. The source for Classic, as is, is meant to be built in Visual Studio 2010.

I have to run a few errands but i'll boot into Mint later and see if I can't figure it out.

mike-1-2-3 commented 7 years ago

Edit: nevermind, figured out how to apply the patch. I'll let you know how building goes.

mike-1-2-3 commented 7 years ago

Thanks for your quick response!

Yeah, in Debian Sid, trying to build classic, my steps are:

Am I missing a step?

Serosis commented 7 years ago

Okay, it appears to be a byproduct of committing what I build on Windows and permissions not sticking on things that should be executable.

Make build.sh executable, which I see you've already done.

Then go into the ./build/unix folder and make build.sh, build_clean, build_collect, recurse, and uqm-wrapper.in executable as well.

After that you run the command, "./build.sh uqm clean"

From there you run the config again and build uqm as usual.

EDIT:

As a warning, I get two errors:

/usr/bin/ld: obj/release/src/libs/graphics/drawable.c.o: undefined reference to symbol 'atan2@@GLIBC_2.2.5' //lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line

But I also get these errors on the vanilla source code from sc2.sourceforge.net and I am not well versed in Linux enough to figure out what that even means.

mike-1-2-3 commented 7 years ago

Thanks! That got me a lot further. The error you ran into is simple to fix. In line 137 of build/unix/build.config the linker flag "-lm" needs to be included.

Now the problem I'm getting is undefined variables that the mod added in, for example:

src/uqm/gameinp.c:436:89: error: ‘optGodMode’ undeclared (first use in this function)
  if (!(PlayerControl[0] & COMPUTER_CONTROL && PlayerControl[1] & COMPUTER_CONTROL) && ((optGodMode) &&

In that example I was able to hard code it to false, since I'm just interested in the Kohr Ah advancing setting. I'll keep doing that and see if it works.

iuriguilherme commented 7 years ago

@mike-1-2-3 you should do ./build.sh uqm config first, and make sure the option number 1 is not set to debug (if you press 1, 1, enter, that's taken care of)

edit: nevermind, this is related to the op

Serosis commented 7 years ago

Interesting, you should try checking out the vanilla UQM source and applying the 0.7.3a-GCC.diff patch.

I have a feeling that what I've committed over the course of switching to Github might not play nice at all with Linux.

iuriguilherme commented 7 years ago

@Serosis applying 0.7.3a-VC10toGCC.diff patch worked for me, build went fine

Also, i have a feeling that github is better than sourceforge

iuriguilherme commented 7 years ago

Only thing that i couldn't get working is the content files. Despite having downloaded many times, checking the files, trying different locations, I still get the same error:

  *** FATAL ERROR: Could not load basic content ***

UQM requires at least the base content pack to run properly.
This file is typically called uqm-0.7.0-content.uqm.  UQM was expecting
it in the /usr/share/uqm/content/packages directory.
Either your installation did not install the content pack at all, or it
installed it in a different directory.

Fix your installation and rerun UQM.

  *******************

The content file is there, permissions are 0644, the folder structure is perfect as in the wiki.

Even vanilla and uqm-hd are giving me this same error.

Pior to the error, the log also shows this:

Warning: Could not mount 'uqm-0.7.0-content.uqm': No such device.

Update: I didn't have zlib.

iuriguilherme commented 7 years ago

For the record, dependencies for Fedora:

sudo dnf install gcc libmikmod-devel SDL-devel SDL_image-devel libvorbis-devel zlibrary-devel
mike-1-2-3 commented 7 years ago

I ended up just removing the Kohr-Ah event from line 142 of gameev.c of the original code. Hopefully that will do the trick. In any case, I think there's probably enough info in this thread to help people build this if they want to. I probably just messed something up with patching, since it worked for desci. So I'll close this issue.

iuriguilherme commented 7 years ago

I never got the hd version to work well, but I think that's related to the hd version and my own system. I didn't explore all the options though.

The classic version is working well.