Page 1 of 1

Difficulty Compiling MechVM for Ubuntu 10.04

Posted: Tue Sep 28, 2010 4:52 pm
by IronChefBoyardee
I followed the instructions for compiling, and after I entered

Code: Select all

make
This came up

Code: Select all

g++ -c -pipe -O2 -Wall -W -D_REENTRANT -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 BGBase.o BGBase.cpp
In file included from GLLabel.h:9,
                 from BGBase.cpp:153:
GLWindow.h:11:21: error: SDL/SDL.h: No such file or directory
In file included from BGBase.cpp:7:
BGString.h: In member function ‘void BGString::print() const’:
BGString.h:153: warning: format not a string literal and no format arguments
BGString.h: In member function ‘void BGString::printLn() const’:
BGString.h:162: warning: format not a string literal and no format arguments
BGString.h:162: warning: format not a string literal and no format arguments
In file included from GLLabel.h:9,
                 from BGBase.cpp:153:
GLWindow.h: At global scope:
GLWindow.h:14: error: ‘SDL_keysym’ does not name a type
GLWindow.h:45: error: ‘BGKey’ has not been declared
GLWindow.h:148: error: variable or field ‘storeScreenSettings’ declared void
GLWindow.h:148: error: ‘SDL_Surface’ was not declared in this scope
GLWindow.h:148: error: ‘screen’ was not declared in this scope
In file included from BGBase.cpp:153:
GLLabel.h:40: error: ‘BGKey’ has not been declared
BGBase.cpp: In function ‘bool loadLangFile(const TCHAR*)’:
BGBase.cpp:213: warning: comparison between signed and unsigned integer expressions
make: *** [BGBase.o] Error 1
Since I'm fairly new to compiling (and Linux), I wasn't sure what it meant, but after this message I attempted to open ./mechvm and it failed

Code: Select all

n-laptop:~/Documents/MechVM-2010-06-15/src$ ./mechvm
bash: ./mechvm: No such file or directory
If I'm overlooking something obvious I'd appreciate some guidance. Thank you in advance.

Re: Difficulty Compiling MechVM for Ubuntu 10.04

Posted: Thu Sep 30, 2010 12:55 pm
by Skyfaller
You seem to be missing the headers for SDL, probably need to install a package called SDL-devel.

Re: Difficulty Compiling MechVM for Ubuntu 10.04

Posted: Sun Oct 03, 2010 5:36 pm
by IronChefBoyardee
I will try that and post here with the results. Thank you very much.

Re: Difficulty Compiling MechVM for Ubuntu 10.04

Posted: Sun Dec 12, 2010 1:02 am
by dopefish7590
Necropost, yes... But you would need the package "libsdl1.2-dev"...
So

Code: Select all

sudo apt-get install libsdl1.2-dev
in your terminal should do it...

But you still won't be able to compile fully with that... To the developers of MechVM... You might want to change the linker options in the makefile since the old GTK libraries are no longer supported by most Linux distros... Meaning that GTK 2 would have to be used... I successfully compiled it after changing the linker option for glut to "-lglut `pkg-config --cflags gtk+-2.0 --libs`" :)

Ironchef: To compile, after typing "make" and running that, copypasta the following into your terminal:

Code: Select all

g++ -Wl,-O1 -o ../mechvm Archive.o BGBase.o BGString.o BipedMech.o Color.o Config.o Database_MW2.o dialogs.o FileCache.o FramerateCounter.o GLButton.o GLComboBox.o GLContextMenu.o GLLabel.o GLLineEdit.o GLScrollbar.o GLSlider.o GLSplitter.o GLTableView.o GLWindowContainer.o GLWindow.o Heightfield.o intersections.o LZdecode.o Matrix.o MechVM.o MechLab.o MechShell.o MechSim.o MechWarriorInstallers.o MechWarriorIIPRJ.o MechWarrior3ZBD.o Mesh.o MeshPolygon.o Mesh2.o MWBase.o MW2MechImporter.o Point3D.o QuadMech.o RenderableObject.o Texture.o TextureCompiler.o Toolbar.o VehicleAI.o Vehicles.o XMLTree.o -L/usr/lib -lGLU -lglut `pkg-config --cflags gtk+-2.0 --libs` -lSDL -lQtGui -lQtCore -lpthread
Oh, and the executables that were packaged for DOSBox will have to be renamed, then the original location linked to a local install of DOSBox... If you don't have it:

Code: Select all

sudo apt-get install dosbox
Then navigate to the DOSBox folder in your MechVM path... And do the following:

Code: Select all

cd DOSBox*
mv ./DOSBox.exe ./DOSBox.exe2
ln -s /usr/bin/dosbox ./DOSBox.exe
Things are very shaky, but the Mechlab works well, the games have problems of their own. :(