Compiling MechVM on Linux

MechVM - A MechWarrior 2 remake.

Moderator: Skyfaller

Post Reply
User avatar
theAntiBob
I.S. Baby
Posts: 1
Joined: Sat Nov 12, 2011 2:37 pm
Location: frozenWasteland, AK

Compiling MechVM on Linux

Post by theAntiBob » Mon Jun 18, 2012 2:30 pm

Trying to compile MechVM on Xubuntu fials for me. All dependencies are fulfilled.

Here is the console output:
theantibob@SpyRon:~/Games/MechVM-2011-04-04/src$ make
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I/opt/gnome/include/gtk-1.2 -I/opt/gnome/include/glib-2.0 -I/opt/gnome/include/glib-1.2 -I/opt/gnome/lib/glib-2.0/include -I. -o Archive.o Archive.cpp
In file included from BGString.h:18:0,
from MWBase.h:9,
from Archive.h:11,
from Archive.cpp:8:
BGVector.h: In member function ‘const T& BGVector<T, bufID>::operator[](size_t) const’:
BGVector.h:61:75: error: there are no arguments to ‘ExceptionBase’ that depend on a template parameter, so a declaration of ‘ExceptionBase’ must be available [-fpermissive]
BGVector.h:61:75: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
In file included from MWBase.h:9:0,
from Archive.h:11,
from Archive.cpp:8:
BGString.h: In member function ‘void BGFilePath<C>::getCWD()’:
BGString.h:1047:36: error: ‘chars’ was not declared in this scope
BGString.h:1047:43: error: ‘reserved’ was not declared in this scope
BGString.h:1048:32: error: there are no arguments to ‘setReserve’ that depend on a template parameter, so a declaration of ‘setReserve’ must be available [-fpermissive]
BGString.h:1051:7: error: ‘length’ was not declared in this scope
BGString.h:1051:25: error: ‘chars’ was not declared in this scope
BGString.h: In member function ‘bool BGFilePath<C>::changeExtension(const char*)’:
BGString.h:1058:11: error: ‘length’ was not declared in this scope
BGString.h:1060:25: error: ‘chars’ was not declared in this scope
BGString.h:1061:28: error: there are no arguments to ‘setLength’ that depend on a template parameter, so a declaration of ‘setLength’ must be available [-fpermissive]
BGString.h: In member function ‘bool BGFilePath<C>::exists() const’:
BGString.h:1073:25: error: ‘chars’ was not declared in this scope
BGString.h:1073:30: error: there are no arguments to ‘fileExists’ that depend on a template parameter, so a declaration of ‘fileExists’ must be available [-fpermissive]
In file included from MechWarrior3ZBD.h:14:0,
from Archive.cpp:11:
Point3D.h: In constructor ‘Point3<T>::Point3(T, T, T)’:
Point3D.h:204:23: error: ‘Point3f_ID’ was not declared in this scope
Point3D.h: In constructor ‘Point3<T>::Point3(const Point3D&)’:
Point3D.h:208:23: error: ‘Point3f_ID’ was not declared in this scope
make: *** [Archive.o] Error 1
Any suggestions? I get the feeling I need to pass -fpermissive to g++ somehow, but i'm not sure how.

User avatar
Skyfaller
Clan 2nd MechWarrior
Clan 2nd MechWarrior
Posts: 991
Joined: Sat Apr 12, 2008 2:58 am
Location: Germany
Contact:

Re: Compiling MechVM on Linux

Post by Skyfaller » Wed Jun 27, 2012 2:15 am

I am currently working on a new release, so I'd rather provide fixes for this 14 months old release only when necessary. I want to improve Unicode support for Windows, but this breaks a lot of existing functionality.

MechVM can be made to work under Linux, but functionality is reduced. Under Linux, MechVM will not launch MW2. You can install games, but you have to manually configure DosBox to use them. I could improve Linux support, but people really rarely ask for it.

Under Linux, you could try running MechVM in Wine. That is probably the best option currently.

Let me know if you have further questions.
Download MechVM

If you have problems with MechVM, please attach the files MechVM.cfg and install-report.txt from the folder where MechVM installed your game.

Ademan
I.S. Baby
Posts: 3
Joined: Sun Aug 05, 2012 10:12 pm

Re: Compiling MechVM on Linux

Post by Ademan » Sun Aug 05, 2012 10:25 pm

Hi theAntiBob,
Where did you get your makefile? I hacked together my own (it's terrible) and was able to build it. I didn't end up depending on any gtk/glib things. I also had to remove ExceptionBase (it's only used in one place!). I made a handfull of other changes ( the errors with chars,reserved,length can all be squashed with 'using TBGString<C>::chars' etc ). In addition I had to implement bgGetFileSize() and renamed _rmdir to the standard C remove(). I'm not sure that last change is correct, my C is a bit rusty, but unistd.h defines rmdir() which definitely would work.

I'm fairly certain that's all I did, but if you'd like and Skyfaller approves, I can post my changes for you somewhere.

Cheers,
Dan

EDIT: I should mention that all I've managed to do thus far is "install" MW2 and see the imported mechs running in the Mech Lab. If I go to "play game" there's nothing to select. I'm still not clear on the relationship between DOSBox and MechVM so that might be expected on linux.

User avatar
Skyfaller
Clan 2nd MechWarrior
Clan 2nd MechWarrior
Posts: 991
Joined: Sat Apr 12, 2008 2:58 am
Location: Germany
Contact:

Re: Compiling MechVM on Linux

Post by Skyfaller » Mon Aug 06, 2012 8:52 pm

It is not necessary to create your own makefile - use "qmake; make" to compile MechVM under Linux. MechVM is open source; of course, you can post fixes.
Unfortunately, I have not found time to put into MechVM for weeks, and I don't expect this to get better before September.

If you can use the MechLab in MechVM, that is all that currently works in MechVM. I was working on a sim, but I'm not sure what you have to do to unlock it. MechVM's sim allows walking around in your mech, but not shooting and no AI, on a small, grey landscape.

It would be possible to integrate DosBox for Linux into MechVM. This would allow either to launch MW2 including MW2's shell or MechVM's shell.
Download MechVM

If you have problems with MechVM, please attach the files MechVM.cfg and install-report.txt from the folder where MechVM installed your game.

Post Reply