aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Pages: 1 [2]

Author Topic: Can't compile AmuleGUI SVN with WxMSW 2.8.0 (Windows port)  (Read 9703 times)

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: Can't compile AmuleGUI SVN with WxMSW 2.8.0 (Windows port)
« Reply #15 on: April 17, 2007, 04:42:55 AM »

lol, you mean you patched wx? :D
Logged

dO_Ob

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 1
Re: Can't compile AmuleGUI SVN with WxMSW 2.8.0 (Windows port)
« Reply #16 on: April 19, 2007, 04:28:39 PM »

I just used the dirtiest trick in the book.. I commented out the faulting function declaration :)

I don't think this as a patch would make it to any kind of releases :p
AddJob conflicts with winspool.h. Ain't pretty either, but one can add something like
Code: [Select]
#ifdef __WXMSW__
#define _WINSPOOL_H
#endif
to PartFileConvert.cpp.

There was that TransferWnd.cpp error then. You can get pass it by including wxmsw windows.h wrapper (winwrap.h or wrapwin.h, I ain't at my pc now, can't tell).

In the end it compiled but when runned amule (monolithic app) plain won't connect to anyone (sees no sources) and crashes when you press prefs button.
Logged

Radek

  • Full Member
  • ***
  • Karma: 5
  • Offline Offline
  • Posts: 149
Compilation errors AmuleGUI SVN / WxMSW 2.9
« Reply #17 on: May 06, 2007, 04:48:58 PM »

Hi (long time no see)!

I used a slightly different workaround for this issue in PartFileConvert.cpp: I placed the line
Code: [Select]
#undef AddJobafter the section with the includes. The problem is the definition
Code: [Select]
#define AddJob AddJobWin mingw/include/winspool.h, which is included by mingw/include/windows.h. Seems to be needed for the functions AddJobA() and AddJobW() in winspool.dll.
Neither my workaround nor Nodsu's is very pretty, I think  :(
The only other solution would be to rename the method AddJob() to anything else, for example AddThisJob(). But the approach of the Mingw include-files with their macro definitions might be a source of further fun to come...

TranferWnd.cpp:
Either wrapwin.h or winundef.h (which is included by wrapwin.h) help getting around this trap. I didn't make any further investigations yet
Code: [Select]
#ifdef __WXMSW__
    //#include <wx/msw/wrapwin.h>
    #include <wx/msw/winundef.h>
#endif

My next (and last) problem with today's SVN was an error in OtherFunctions.cpp, which was caused by wrong case-constants in GetMaxConnections() (starting in line 348). I changed the switch statement to
Code: [Select]
switch ( os ) {
//20070506/Radek - Values for OS-IDs from wx/platinfo.h (wxWidgets 2.9)
// case wxWIN95: return 50; // This includes all Win9x versions
case wxOS_WINDOWS_9X: return 50; // This includes all Win9x versions
// case wxWINDOWS_NT: return 500; // This includes NT based windows
case wxOS_WINDOWS_NT: return 500; // This includes NT based windows
default: return -1; // Anything else. Let aMule decide...
}
After these three little changes (and the aforementioned perl-script issue with switch, of course) I could compile today's SVN! It's the first time since October, 28th 2006, that I was able to do so (also being the first time since that date, that I had time to take a more than cursory glance into the compilation errors  ;))

BTW: I use wxWindows (wxMSW) 2.9 (CVS).

Now a little testing and I will upload the binaries on my FTP-Server (further information here)
« Last Edit: May 08, 2007, 07:27:31 PM by Radek »
Logged
There are 10 kinds of people - those who are able to understand binary numbers and those who aren't...

wuischke

  • Developer
  • Hero Member
  • *****
  • Karma: 183
  • Offline Offline
  • Posts: 4292
Re: Can't compile AmuleGUI SVN with WxMSW 2.8.0 (Windows port)
« Reply #18 on: May 06, 2007, 07:23:40 PM »

Very nice :)
Logged

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: Can't compile AmuleGUI SVN with WxMSW 2.8.0 (Windows port)
« Reply #19 on: May 07, 2007, 05:08:06 AM »

Hi Radek,

There seems to be a bug in this switch code, I think that the break's are missing.

Anyway, I have included your three suggestions in tomorrow's tarball, so please, would you test it for me? You know, I have no windows box here to test it.

Cheers!
Logged

Radek

  • Full Member
  • ***
  • Karma: 5
  • Offline Offline
  • Posts: 149
Re: Can't compile AmuleGUI SVN with WxMSW 2.8.0 (Windows port)
« Reply #20 on: May 07, 2007, 09:44:01 AM »

@phoenix
I'll test the changes, of course. Right now the compilation for the daily wxWidgets-checkout is in progress. This takes quite some time in MingW...

Concerning the switch in OtherParts.cpp: the cases had a return as last (and only) statement. I didn't see that on first glance, either ;) But I like it better, the way you changed it in today's SVN. It's more code (text), but easier to read/scan, at least for me.

-- Edit
While compiling today's SVN-Snapshot, I ran into the following error (unrelated to your changes):
Code: [Select]
if g++ -DHAVE_CONFIG_H -I. -I/home/rb/src/amule-cvs/src -I..    -I/mingw/lib/wx/include/msw-unicode-release-static-2.9 -I/mingw/include/wx-2.9 -D__WXMSW__ -mthreads -I/home/rb/src/amule-cvs/src/libs  -DNOMINMAX -DUSE_EMBEDDED_CRYPTO -W -Wall -Wshadow -Wundef -g -ggdb -fno-inline -D__DEBUG__ -fmessage-length=0 -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC   -DUSE_WX_EXTENSIONS -MT libmuleappgui_a-MuleGifCtrl.o -MD -MP -MF ".deps/libmuleappgui_a-MuleGifCtrl.Tpo" -c -o libmuleappgui_a-MuleGifCtrl.o `test -f 'MuleGifCtrl.cpp' || echo '/home/rb/src/amule-cvs/src/'`MuleGifCtrl.cpp; \
then mv -f ".deps/libmuleappgui_a-MuleGifCtrl.Tpo" ".deps/libmuleappgui_a-MuleGifCtrl.Po"; else rm -f ".deps/libmuleappgui_a-MuleGifCtrl.Tpo"; exit 1; fi
In file included from p:/sources/amule-cvs/src/MuleGifCtrl.cpp:26:
e:/msys/mingw/include/wx-2.9/wx/mstream.h: In copy constructor `wxMemoryInputStream::wxMemoryInputStream(wxMemoryInputStream&)':
e:/msys/mingw/include/wx-2.9/wx/mstream.h:34: warning: base class `class wxInputStream' should be explicitly initialized in the copy constructor
p:/sources/amule-cvs/src/MuleGifCtrl.cpp: In member function `void MuleGifCtrl::Start()':
p:/sources/amule-cvs/src/MuleGifCtrl.cpp:120: error: no matching function for call to `wxTimerEvent::wxTimerEvent()'
e:/msys/mingw/include/wx-2.9/wx/timer.h:167: note: candidates are: wxTimerEvent::wxTimerEvent(const wxTimerEvent&)
e:/msys/mingw/include/wx-2.9/wx/timer.h:156: note:                 wxTimerEvent::wxTimerEvent(wxTimer&)
make[3]: *** [libmuleappgui_a-MuleGifCtrl.o] Error 1
For that I made this quick and dirty patch, which got me around this little obstacle
Code: [Select]
// wxTimerEvent evt;
// OnTimer(evt);
wxTimerEvent *pevt;
OnTimer(*pevt);
But:
your modification in TransferWnd.cpp again leads to the same curious error as before. The #include for winundef.h needs to be somewhere before the inclusion of amuleDlg.h. After moving it to lines 32ff, it compiles well.

Next little obstacle is in OtherFunctions.cpp, GetMaxConnections(), line 360: <wxString>.ToLong() wants a Ptr to long, so I made a temporary variable to get around this
Code: [Select]
        long lTemp;
        //value.ToLong(&maxconn);
value.ToLong(&lTemp);
        maxconn = (int)lTemp;
Also, a break (or at least an empty) statement is needed after the default case, otherwise gcc complains about missing ';'

No further problems...
« Last Edit: May 07, 2007, 12:10:16 PM by Radek »
Logged
There are 10 kinds of people - those who are able to understand binary numbers and those who aren't...

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: Can't compile AmuleGUI SVN with WxMSW 2.8.0 (Windows port)
« Reply #21 on: May 08, 2007, 01:21:01 PM »

Radek,

Please, do not use wx-CVS to build it. You don't know if this new interface is stable. And it certainly breaks compatibility will everithing that came before without a warning, so I would say that by now, wxTimerEvent is broken in wxCVS. Please use wx-2.8.3 and this is a non-issue. wxDevelopers never break an API without a "deprecation" release in the middle.

As for the rest, you can try tomorrow CVS and see if we have a go now.

Cheers!
Logged

Radek

  • Full Member
  • ***
  • Karma: 5
  • Offline Offline
  • Posts: 149
Re: Can't compile AmuleGUI SVN with WxMSW 2.8.0 (Windows port)
« Reply #22 on: May 08, 2007, 07:51:01 PM »

@Phoenix

Ok, I'll do so!
Compilation of the desired version of wxWidgets is in progress on my WIN$ box (veeery slow - sometimes MSys/MingW shows unexplainable bad attitudes: configure alone took more than 2 hours :(). Afterwards, I'll try to compile today's SVN snapshot again.

-- Edit

You were of course right: the issue with the nonexistent wxTimerEvent constructor is not there with wxWidget 2.8 branch. So, I'll stick to that...

Cheers...
« Last Edit: May 08, 2007, 10:45:50 PM by Radek »
Logged
There are 10 kinds of people - those who are able to understand binary numbers and those who aren't...

Radek

  • Full Member
  • ***
  • Karma: 5
  • Offline Offline
  • Posts: 149
Compilation error aMule SVN20070509 WxMSW 2.8.x (Windows port)
« Reply #23 on: May 09, 2007, 08:25:26 AM »

Hi, Phoenix!

With today's snapshot I get this for OtherFunctions.cpp
Code: [Select]
if g++ -DHAVE_CONFIG_H -I. -I/home/rb/src/amule-cvs/src -I..     -I/mingw/lib/wx/include/msw-unicode-release-static-2.8 -I/mingw/include/wx-2.8 -D__WXMSW__ -mthreads    -I/home/rb/src/amule-cvs/src/libs -Ilibs -DNOMINMAX -DUSE_EMBEDDED_CRYPTO -W -Wall -Wshadow -Wundef -g -ggdb -fno-inline -D__DEBUG__ -fmessage-length=0 -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC   -DUSE_WX_EXTENSIONS -MT amule-OtherFunctions.o -MD -MP -MF ".deps/amule-OtherFunctions.Tpo" -c -o amule-OtherFunctions.o `test -f 'OtherFunctions.cpp' || echo '/home/rb/src/amule-cvs/src/'`OtherFunctions.cpp; \
then mv -f ".deps/amule-OtherFunctions.Tpo" ".deps/amule-OtherFunctions.Po"; else rm -f ".deps/amule-OtherFunctions.Tpo"; exit 1; fi
p:/sources/amule-cvs/src/OtherFunctions.cpp: In function `int GetMaxConnections()':
p:/sources/amule-cvs/src/OtherFunctions.cpp:376: error: expected primary-expression before '}' token
p:/sources/amule-cvs/src/OtherFunctions.cpp:376: error: expected `;' before '}' token
make[3]: *** [amule-OtherFunctions.o] Error 1

This is the same error as described for yesterday's snapshot: gcc (at least the MingW version) wants to have some statement after 'default:', or, to be precise, before the closing '}'. So I added a 'break;':
Code: [Select]
default:
// Anything else. Let aMule decide...
                        break;      //#2070508/Radek - compiler throws error without break (or at least ';')
}

No other problems encountered!

Cheers...
« Last Edit: May 09, 2007, 09:49:30 AM by Radek »
Logged
There are 10 kinds of people - those who are able to understand binary numbers and those who aren't...

phoenix

  • Evil respawning bird from aMule Dev Team
  • Developer
  • Hero Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 2503
  • The last shadow you'll ever see
Re: Can't compile AmuleGUI SVN with WxMSW 2.8.0 (Windows port)
« Reply #24 on: May 11, 2007, 03:29:40 PM »

Committed.
Logged

Radek

  • Full Member
  • ***
  • Karma: 5
  • Offline Offline
  • Posts: 149
Re: Can't compile AmuleGUI SVN with WxMSW 2.8.0 (Windows port)
« Reply #25 on: May 12, 2007, 11:33:25 AM »

Works fine now.

Cheers
Logged
There are 10 kinds of people - those who are able to understand binary numbers and those who aren't...
Pages: 1 [2]