MegaGlest Forum
Archives (read only) => Vanilla Glest => Linux and other ports => Topic started by: lardmaster on 7 November 2007, 20:19:55
-
NOTE: i am running debian
By looking around the forums, i got a good idea about what to do to get it to compile:
for reference by anyone else
1. Downloaded the source from http://sourceforge.net/project/showfile ... _id=127297 (http://sourceforge.net/project/showfiles.php?group_id=127297) and unzipped it
2. Downloaded the patch from http://www.webalice.it/gborzi1/glest_ma ... .patch.bz2 (http://www.webalice.it/gborzi1/glest_map_editor.patch.bz2)
here is a mirror, because the link is sometimes down: http://www.mediafire.com/?8igx2dynwjx (http://www.mediafire.com/?8igx2dynwjx)
3. ran find . -type f -exec dos2unix {} \; //dos2unix comes with the sysutils package
4. unzipped the patch into the ./source/glest_map_editor/ directory
5. cd'd to that directory, and ran patch -p1< glest_map_editor.patch
6. cd'd to the mk/linux directory and ran autogen.sh
7. ran ./configure // note: i had to find a few packages before i got this step right, most foremost, non unicode wxgtk, which can be found at the wxpython apt repositories (yes... the C++ packages too) also, i had install both the normal and the ansi versions of wxgtk, because the ansi one does not include wx-config, which ./configure checks for before comiling the map editor
8. jam
at this point, the game compiled nicely, but the map editor got
C++ ./build/i686-pc-linux-gnu/optimize/glest_map_editor/main.o
In file included from /usr/include/wx-2.8/wx/wx.h:21,
from glest_map_editor/main.h:7,
from glest_map_editor/main.cpp:1:
/usr/include/wx-2.8/wx/hashmap.h: In member function 'wxLongToLongHashMap_wxImplementation_HashTable::Node** wxLongToLongHashMap_wxImplementation_HashTable::GetNodePtr(const long int&) const':
/usr/include/wx-2.8/wx/hashmap.h:714: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from /usr/include/wx-2.8/wx/event.h:18,
from /usr/include/wx-2.8/wx/wx.h:25,
from glest_map_editor/main.h:7,
from glest_map_editor/main.cpp:1:
/usr/include/wx-2.8/wx/clntdata.h: In member function 'wxShadowObjectMethods_wxImplementation_HashTable::Node** wxShadowObjectMethods_wxImplementation_HashTable::GetNodePtr(const wxString&) const':
/usr/include/wx-2.8/wx/clntdata.h:20: warning: dereferencing type-punned pointer will break strict-aliasing rules
/usr/include/wx-2.8/wx/clntdata.h: In member function 'wxShadowObjectFields_wxImplementation_HashTable::Node** wxShadowObjectFields_wxImplementation_HashTable::GetNodePtr(const wxString&) const':
/usr/include/wx-2.8/wx/clntdata.h:25: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from /usr/include/wx-2.8/wx/event.h:21,
from /usr/include/wx-2.8/wx/wx.h:25,
from glest_map_editor/main.h:7,
from glest_map_editor/main.cpp:1:
/usr/include/wx-2.8/wx/gdicmn.h: In member function 'wxStringToColourHashMap_wxImplementation_HashTable::Node** wxStringToColourHashMap_wxImplementation_HashTable::GetNodePtr(const wxString&) const':
/usr/include/wx-2.8/wx/gdicmn.h:544: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from /usr/include/wx-2.8/wx/wx.h:45,
from glest_map_editor/main.h:7,
from glest_map_editor/main.cpp:1:
/usr/include/wx-2.8/wx/image.h: In member function 'wxImageHistogramBase_wxImplementation_HashTable::Node** wxImageHistogramBase_wxImplementation_HashTable::GetNodePtr(const long unsigned int&) const':
/usr/include/wx-2.8/wx/image.h:136: warning: dereferencing type-punned pointer will break strict-aliasing rules
glest_map_editor/main.cpp: In constructor 'Glest::MapEditor::GlCanvas::GlCanvas(Glest::MapEditor::MainWindow*)':
glest_map_editor/main.cpp:489: error: call of overloaded 'wxGLCanvas(Glest::MapEditor::MainWindow*&, int)' is ambiguous
/usr/include/wx-2.8/wx/gtk/glcanvas.h:92: note: candidates are: wxGLCanvas::wxGLCanvas(wxWindow*, const wxGLCanvas*, wxWindowID, const wxPoint&, const wxSize&, long int, const wxString&, int*, const wxPalette&) <near match>
/usr/include/wx-2.8/wx/gtk/glcanvas.h:84: note: wxGLCanvas::wxGLCanvas(wxWindow*, const wxGLContext*, wxWindowID, const wxPoint&, const wxSize&, long int, const wxString&, int*, const wxPalette&) <near match>
/usr/include/wx-2.8/wx/gtk/glcanvas.h:76: note: wxGLCanvas::wxGLCanvas(wxWindow*, wxWindowID, const wxPoint&, const wxSize&, long int, const wxString&, int*, const wxPalette&)
/usr/include/wx-2.8/wx/gtk/glcanvas.h:69: note: wxGLCanvas::wxGLCanvas(wxWindow*, wxWindowID, int*, const wxPoint&, const wxSize&, long int, const wxString&, const wxPalette&)
as an error
i tried to mess around with that constructor, but i dont know C++ too well, and it looks like it is fundamentally missing some information for the constructor.
please help anyone, i think if this error is solved, there should be a pretty straightforward set of instructions for compiling the map editor under linux
-
Great work. When I get some time I'll have a look. Seems like it's a problem with overloaded constructors.
-
thanks, it seems like thier might be more of a bug than just the wrong args for overloading, just because it is missing so many arguments, and most of them do not have variables of that type in that part of the code.
perhaps we could find a way to fill in all the default values
it might be an issue with the library version, becuase the new library might ask for more arguments than the old.
-
If you go to the bottom of main.cpp there is a the GlCanvas class which is what is being called in the MainWindow Constructor which is passing " this" as the argument.
GlCanvas::GlCanvas(MainWindow * mainWindow):
wxGLCanvas(mainWindow, -1)
It's the initialisation list that is the problem which is what you were talking about I think.
it is missing so many arguments
An example provided on the wxWidgets site is
BasicGLPane::BasicGLPane(wxFrame* parent, int* args) :
wxGLCanvas(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, wxT("GLCanvas"), args)http://www.wxwidgets.org/wiki/index.php/WxGLCanvas (http://www.wxwidgets.org/wiki/index.php/WxGLCanvas)
void wxGLCanvas(wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style=0, const wxString& name="GLCanvas", int* attribList = 0, const wxPalette& palette = wxNullPalette)
http://www.wxwidgets.org/manuals/2.6/wx_wxglcanvas.html (http://www.wxwidgets.org/manuals/2.6/wx_wxglcanvas.html)
So you could probably use
GlCanvas::GlCanvas(MainWindow * mainWindow):
wxGLCanvas(mainWindow, -1, wxDefaultPosition, wxDefaultSize, 0, wxT("GLCanvas"), 0, wxNullPalette)
-
ahh, those built in WX defaults should be helpfull :)
-
wx-config-2.8 comes with wxWidgets-devel so you might not need the ansi wxgtk.
-
the setup for compiling has the flag --unicode=no... or something similar...
UPDATE: so i did what you suggested and it seemed to compile... going to run...
so it works... i dont know how to make a patch, but if someone could do it, to replace line 484 with what he posted... that would help a lot of people.