Author Topic: Compiling the map editor under linux  (Read 5405 times)

lardmaster

  • Guest
Compiling the map editor under linux
« 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 and unzipped it
2. Downloaded the patch from http://www.webalice.it/gborzi1/glest_ma ... .patch.bz2

here is a mirror, because the link is sometimes down: 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

Code: [Select]
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
« Last Edit: 1 January 1970, 00:00:00 by lardmaster »

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
(No subject)
« Reply #1 on: 11 November 2007, 11:07:30 »
Great work. When I get some time I'll have a look. Seems like it's a problem with overloaded constructors.
« Last Edit: 1 January 1970, 00:00:00 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

lardmaster

  • Guest
(No subject)
« Reply #2 on: 11 November 2007, 18:37:08 »
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.
« Last Edit: 1 January 1970, 00:00:00 by lardmaster »

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
(No subject)
« Reply #3 on: 12 November 2007, 03:23:34 »
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.

Code: [Select]
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.
Quote from: "lardmaster"
it is missing so many arguments

An example provided on the wxWidgets site is
Code: [Select]
BasicGLPane::BasicGLPane(wxFrame* parent, int* args) :
wxGLCanvas(parent, wxID_ANY,  wxDefaultPosition, wxDefaultSize, 0, wxT("GLCanvas"),  args)
http://www.wxwidgets.org/wiki/index.php/WxGLCanvas

Quote
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

So you could probably use
Code: [Select]
GlCanvas::GlCanvas(MainWindow * mainWindow):
wxGLCanvas(mainWindow, -1, wxDefaultPosition, wxDefaultSize, 0, wxT("GLCanvas"),  0, wxNullPalette)
« Last Edit: 1 January 1970, 00:00:00 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

lardmaster

  • Guest
(No subject)
« Reply #4 on: 13 November 2007, 01:09:11 »
ahh, those built in WX defaults should be helpfull :)
« Last Edit: 1 January 1970, 00:00:00 by lardmaster »

hailstone

  • GAE Team
  • Battle Machine
  • ********
  • Posts: 1,568
    • View Profile
(No subject)
« Reply #5 on: 13 November 2007, 11:25:39 »
wx-config-2.8 comes with wxWidgets-devel so you might not need the ansi wxgtk.
« Last Edit: 1 January 1970, 00:00:00 by hailstone »
Glest Advanced Engine - Admin/Programmer
https://sourceforge.net/projects/glestae/

lardmaster

  • Guest
(No subject)
« Reply #6 on: 20 November 2007, 21:43:07 »
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.
« Last Edit: 1 January 1970, 00:00:00 by lardmaster »

 

anything