aMule Forum
English => Multiplatform => Win32 => Topic started by: Sethur on April 07, 2005, 04:00:10 PM
-
Greetings,
Compiling aMule-CVS-20050407 I still get errors compiling CFile.cpp:
src/CFile.cpp:724: error: no `wxString CDirIterator::FindFirstFileA(CDirIterator::FileType, const wxString&)' member function declared in class `CDirIterator' c:/Programme/MinGW/Include/winbase.h: In member function `wxString CDirIterator::FindFirstFileA(CDirIterator::FileType, const wxString&)': c:/Programme/MinGW/Include/winbase.h:1287: error: too few arguments to function `BOOL FindNextFileA(void*, _WIN32_FIND_DATAA*)' src/CFile.cpp:731: error: at this point in file c:/Programme/MinGW/Include/wx/string.h:284: error: `wxString::wxString(int)' is private src/CFile.cpp:731: error: within this context src/CFile.cpp: At global scope: src/CFile.cpp:735: error: no `wxString CDirIterator::FindNextFileA()' member function declared in class `CDirIterator'
In the "How to Compile..." thread, somebody had the same problems and solved them with the help of Kry.
Can somebody give me a hint what I have to change in CFile.cpp and further files to successfully compile with MinGW/MSsys/wxMSW2.4 ?
-
Search for all the FindFirstFile and FindNextFile on the code and change them to a different name, like FindFirstFileM and FindNextFileM. Whatever except their current name.
-
... or just get tomorrow's tarball, I changed it.
-
Thanks a lot, I'll try compiling it now.
Ah, one more thing: In your MakefileWIN32 are old dependencies for socket.h and packets.h. You should remove them too in the next tarball. Besides you should remove all explicit paths to MinGWStudio, so that ordinary MinGW users don't have to change them all.
-
Ok, I finished adapting the MakefileWIN32, and now the compile hangs at ClientCredits.cpp with the following errors:
src/ChatSelector.cpp:54:2: warning: #warning Needed while not ported
In file included from src/ChatSelector.cpp:56:
src/FriendList.h:67:10: warning: #warning THIS MUST BE MADE PRIVATE AFTER EC IS CODED
src/ChatSelector.cpp:77:10: warning: #warning EC NEEDED
src/ChatSelector.cpp:253:10: warning: #warning EC needed here.
Compiling src/ChatWnd.cpp
Compiling src/ClientCredits.cpp
In file included from src/amule.h:34,
from src/ClientCredits.cpp:45:
c:/Programme/MinGW/Include/wx/app.h:182:49: macro "Yield" passed 1 arguments, but takes just 0
In file included from src/amule.h:34,
from src/ClientCredits.cpp:45:
c:/Programme/MinGW/Include/wx/app.h:182: error: ISO C++ forbids initialization
of member `Yield'
c:/Programme/MinGW/Include/wx/app.h:182: error: making `Yield' static
c:/Programme/MinGW/Include/wx/app.h:182: error: ISO C++ forbids in-class
initialization of non-const static member `Yield'
c:/Programme/MinGW/Include/wx/app.h:182: error: `Yield' declared as a `virtual'
field
In file included from c:/Programme/MinGW/Include/wx/app.h:425,
from src/amule.h:34,
from src/ClientCredits.cpp:45:
c:/Programme/MinGW/Include/wx/msw/app.h:44:49: macro "Yield" passed 1 arguments, but takes just 0
In file included from c:/Programme/MinGW/Include/wx/app.h:425,
from src/amule.h:34,
from src/ClientCredits.cpp:45:
c:/Programme/MinGW/Include/wx/msw/app.h:44: error: `Yield' declared as a
`virtual' field
In file included from src/CryptoPP_Inc.h:30,
from src/ClientCredits.cpp:53:
src/CryptoPP.h: In function `T1 CryptoPP::SaturatingSubtract(T1, T2)':
src/CryptoPP.h:1990: error: syntax error before numeric constant
src/CryptoPP.h:1991: error: syntax error before numeric constant
src/CryptoPP.h: In member function `CryptoPP::GetBlock&
CryptoPP::GetBlock::operator()(U&)':
src/CryptoPP.h:2444: error: syntax error before `;' token
src/CryptoPP.h: In constructor `
CryptoPP::ConstByteArrayParameter::ConstByteArrayParameter(const T&, bool)':
src/CryptoPP.h:4075: error: syntax error before `;' token
The list of objects in MakefileWIN32 after removing socket.cpp & packets.cpp and adding Packet.cpp (hope that was the right thing to do) is:
SRC_OBJS = \
$(OBJ_DIR)/AddFileThread.o \
$(OBJ_DIR)/AddFriend.o \
$(OBJ_DIR)/BarShader.o \
$(OBJ_DIR)/BaseClient.o \
$(OBJ_DIR)/CFile.o \
$(OBJ_DIR)/CatDialog.o \
$(OBJ_DIR)/ChatSelector.o \
$(OBJ_DIR)/ChatWnd.o \
$(OBJ_DIR)/ClientCredits.o \
$(OBJ_DIR)/ClientDetailDialog.o \
$(OBJ_DIR)/ClientList.o \
$(OBJ_DIR)/ClientUDPSocket.o \
$(OBJ_DIR)/ColorFrameCtrl.o \
$(OBJ_DIR)/CommentDialog.o \
$(OBJ_DIR)/CommentDialogLst.o \
$(OBJ_DIR)/DirectoryTreeCtrl.o \
$(OBJ_DIR)/DownloadClient.o \
$(OBJ_DIR)/DownloadListCtrl.o \
$(OBJ_DIR)/DownloadQueue.o \
$(OBJ_DIR)/ED2KLink.o \
$(OBJ_DIR)/EditServerListDlg.o \
$(OBJ_DIR)/ExternalConn.o \
$(OBJ_DIR)/FileDetailDialog.o \
$(OBJ_DIR)/FileDetailListCtrl.o \
$(OBJ_DIR)/Friend.o \
$(OBJ_DIR)/FriendListCtrl.o \
$(OBJ_DIR)/KadDlg.o \
$(OBJ_DIR)/KnownFileList.o \
$(OBJ_DIR)/ListenSocket.o \
$(OBJ_DIR)/MuleGifCtrl.o \
$(OBJ_DIR)/filefn.o \
$(OBJ_DIR)/filemem.o \
$(OBJ_DIR)/MD5Sum.o \
$(OBJ_DIR)/MuleListCtrl.o \
$(OBJ_DIR)/MuleNotebook.o \
$(OBJ_DIR)/OScopeCtrl.o \
$(OBJ_DIR)/PartFile.o \
$(OBJ_DIR)/Packet.o \
$(OBJ_DIR)/Preferences.o \
$(OBJ_DIR)/PrefsUnifiedDlg.o \
$(OBJ_DIR)/QueueListCtrl.o \
$(OBJ_DIR)/SafeFile.o \
$(OBJ_DIR)/SearchDlg.o \
$(OBJ_DIR)/SearchList.o \
$(OBJ_DIR)/SearchListCtrl.o \
$(OBJ_DIR)/ServerList.o \
$(OBJ_DIR)/ServerListCtrl.o \
$(OBJ_DIR)/ServerSocket.o \
$(OBJ_DIR)/ServerWnd.o \
$(OBJ_DIR)/SharedFileList.o \
$(OBJ_DIR)/SharedFilesCtrl.o \
$(OBJ_DIR)/SharedFilesWnd.o \
$(OBJ_DIR)/StatisticsDlg.o \
$(OBJ_DIR)/TransferWnd.o \
$(OBJ_DIR)/UDPSocket.o \
$(OBJ_DIR)/UploadClient.o \
$(OBJ_DIR)/UploadListCtrl.o \
$(OBJ_DIR)/UploadQueue.o \
$(OBJ_DIR)/amule.o \
$(OBJ_DIR)/listctrl.o \
$(OBJ_DIR)/muuli_wdr.o \
$(OBJ_DIR)/otherfunctions.o \
$(OBJ_DIR)/packets.o \
$(OBJ_DIR)/server.o \
$(OBJ_DIR)/sockets.o \
$(OBJ_DIR)/IPFilter.o \
$(OBJ_DIR)/MuleTextCtrl.o \
$(OBJ_DIR)/EMSocket.o \
$(OBJ_DIR)/KnownFile.o \
$(OBJ_DIR)/amuleDlg.o \
$(OBJ_DIR)/ECSocket.o \
$(OBJ_DIR)/SHA.o \
$(OBJ_DIR)/SHAHashSet.o \
$(OBJ_DIR)/AICHSyncThread.o \
$(OBJ_DIR)/UInt128.o \
$(OBJ_DIR)/HTTPDownload.o
RSRC_OBJS = \
$(OBJ_DIR)/amule.res
Any more suggestions? Thanks in advance!
-
Tomorrow we might have a valid build system for win32. Just wait meanwhile ;)
The break of compilation is because some windows defines are conflicting with some wxWidgets ones. It's the same story than the dir iterators above, except we can't change them.
I'll take a look later.
BTW, which compiler are you using?
-
I just updated to the most recent version of the MinGW environment, i.e.:
- gcc-core-3.4.2
- gcc-g++-3.4.2
- MSYS 1.1.0
- MSYS Developer Tool Kit 1.0.10
- mingw-runtime-3.7
- w32api-3.2
- binutils-2.15.91
- gdb-5.2.1
Before the update I was practically using the same system, except that the gcc/g++ version was 3.3.3, but I don't think this will make a difference.
-
I'm currently working on the win32 version of aMule. Once it compiles clean, I'll commit/submit the patches, and create valid MakefileWIN32 and configWIN32 files.
Btw, embedded crypto (currently) cannot be compiled with the mingw compilers, you have to use an external crypto++ library.
-
What's up with the win32 adapted build? Today's (04/08) tarball still has the depricated entries in MakefileWIN32.
However, after using an external crypto++ library, changing Yield to some other name in wx/app.h and removing some other obsolete entries in MakefileWIN32 i was able to compile the whole thing till "SearchListCtrl.cpp". There, the compiler gives me the following error:
Compiling src/SearchListCtrl.cpp
In file included from src/SearchListCtrl.h:35,
from src/SearchListCtrl.cpp:30:
src/MuleListCtrl.h:64: error: expected class-name before '{' token
src/MuleListCtrl.h:72: error: expected `)' before '*' token
src/MuleListCtrl.h:188: error: variable or field `SetSortFunc' declared void
src/MuleListCtrl.h:188: error: expected `;' before '(' token
src/MuleListCtrl.h:196: error: `wxListCtrlCompare' does not name a type
src/MuleListCtrl.h:272: error: variable or field `OnColumnRClick' declared void
src/MuleListCtrl.h:272: error: expected `;' before '(' token
src/MuleListCtrl.h:276: error: variable or field `OnColumnLClick' declared void
src/MuleListCtrl.h:276: error: expected `;' before '(' token
src/MuleListCtrl.h:280: error: variable or field `OnMenuSelected' declared void
src/MuleListCtrl.h:280: error: expected `;' before '(' token
src/MuleListCtrl.h:284: error: variable or field `OnMouseWheel' declared void
src/MuleListCtrl.h:284: error: expected `;' before '(' token
src/MuleListCtrl.h:290: error: expected `;' before '(' token
src/MuleListCtrl.h:303: error: `wxListCtrlCompare' does not name a type
src/MuleListCtrl.h:306: error: ISO C++ forbids declaration of `DECLARE_EVENT_TABLE' with no type
src/MuleListCtrl.h:306: error: expected `;' before '}' token
src/MuleListCtrl.h:306: error: expected `;' before '}' token
In file included from src/SearchListCtrl.cpp:30:
src/SearchListCtrl.h:62: error: expected `)' before '*' token
src/SearchListCtrl.h:177: error: variable or field `OnRightClick' declared void
src/SearchListCtrl.h:177: error: expected `;' before '(' token
src/SearchListCtrl.h:182: error: variable or field `OnItemActivated' declared void
src/SearchListCtrl.h:182: error: expected `;' before '(' token
src/SearchListCtrl.h:189: error: variable or field `OnColumnLClick' declared void
src/SearchListCtrl.h:189: error: expected `;' before '(' token
src/SearchListCtrl.h:196: error: variable or field `OnColumnResize' declared void
src/SearchListCtrl.h:196: error: expected `;' before '(' token
src/SearchListCtrl.h:202: error: variable or field `OnPopupGetUrl' declared void
src/SearchListCtrl.h:202: error: expected `;' before '(' token
src/SearchListCtrl.h:207: error: variable or field `OnPopupFakeCheck' declared void
src/SearchListCtrl.h:207: error: expected `;' before '(' token
src/SearchListCtrl.h:212: error: variable or field `OnRazorStatsCheck' declared void
src/SearchListCtrl.h:212: error: expected `;' before '(' token
src/SearchListCtrl.h:217: error: variable or field `OnPopupDownload' declared void
src/SearchListCtrl.h:217: error: expected `;' before '(' token
src/SearchListCtrl.h:220: error: ISO C++ forbids declaration of `DECLARE_EVENT_TABLE' with no type
src/SearchListCtrl.h:220: error: expected `;' before '}' token
src/SearchListCtrl.h:220: error: expected `;' before '}' token
src/SearchListCtrl.cpp:47: error: no `const wxEventTable* CSearchListCtrl::GetEventTable() const' member function declared in class `CSearchListCtrl'
src/SearchListCtrl.cpp: In member function `const wxEventTable* CSearchListCtrl::GetEventTable() const':
src/SearchListCtrl.cpp:47: error: `sm_eventTable' is not a member of `CSearchListCtrl'
src/SearchListCtrl.cpp: At global scope:
src/SearchListCtrl.cpp:47: error: `const wxEventTable CSearchListCtrl::sm_eventTable' is not a static member of `class CSearchListCtrl'
src/SearchListCtrl.cpp:47: error: `sm_eventTable' is not a member of `CMuleListCtrl'
src/SearchListCtrl.cpp:47: error: `sm_eventTableEntries' is not a member of `CSearchListCtrl'
src/SearchListCtrl.cpp:47: error: `const wxEventTableEntry CSearchListCtrl::sm_eventTableEntries[]' is not a static member of `class CSearchListCtrl'
src/SearchListCtrl.cpp:48: error: `OnRightClick' is not a member of `CSearchListCtrl'
src/SearchListCtrl.cpp:49: error: `OnColumnLClick' is not a member of `CSearchListCtrl'
src/SearchListCtrl.cpp:49: error: `EVT_LIST_COL_CLICK' was not declared in this scope
src/SearchListCtrl.cpp:50: error: expected `}' before "EVT_LIST_COL_END_DRAG"
src/SearchListCtrl.cpp:50: error: expected `,' or `;' before "EVT_LIST_COL_END_DRAG"
src/SearchListCtrl.cpp:60: error: expected declaration before '}' token
Maybe I have tomatoes on my eyes, but I don't find even the first error in the list in "MuleListCtrl.h". The relevant code part ist:
58: #include
59: #define wxLC_OWNERDRAW 0
60: #include
61: #include
62:
63: class CMuleListCtrl : public wxListCtrl
64: {
65: public:
Any hints, as always, are welcome!
-
(no time yet to update the windows build, sorry)
About this error, we need Xaignar to explain about the listctrl patches on Win32.
summons Xaignar
-
That's strange, since it seems that wxListCtrl isn't defined ...
You could possibly fix it by adding "and 0" to the "#ifdef __WXMSW__" in both the .h and .cpp file, so that the universal listctrl-widget is used.
-
Hmm, I am not sure, which cpp and h files you mean, but if it's SearchListCtrl.cpp/h, neither has a line #ifdef __WXMSW__ in the code.
-
MuleListCtr.h and MuleListCtrl.cpp
-
I removed the #ifdef __WXMSW__ in both "MuleListCtrl.h" and "MuleListCtrl.cpp". As a consequence, the class "CMuleListCtrl" should have "MuleExtern::wxListCtrl" as a superclass now, instead of "wxListCtrl". Compiling now, it breaks at "MuleListCtrl.cpp" with the following list of errors:
Compiling src/MuleListCtrl.cpp
In file included from src/MuleListCtrl.cpp:38:
src/MuleListCtrl.h:67:1: warning: "wxLC_OWNERDRAW" redefined
In file included from src/MuleListCtrl.h:59,
from src/MuleListCtrl.cpp:38:
src/extern/listctrl.242.h:30:1: warning: this is the location of the previous definition
In file included from src/MuleListCtrl.h:68,
from src/MuleListCtrl.cpp:38:
c:/Programme/MinGW/Include/wx/msw/imaglist.h:43: error: conflicting declaration 'wxIMAGE_LIST_NORMAL'
c:/Programme/MinGW/Include/wx/generic/imaglist.h:47: error: 'wxIMAGE_LIST_NORMAL' has a previous declaration as ` wxIMAGE_LIST_NORMAL'
c:/Programme/MinGW/Include/wx/msw/imaglist.h:43: error: declaration of `wxIMAGE_LIST_NORMAL'
c:/Programme/MinGW/Include/wx/generic/imaglist.h:47: error: conflicts with previous declaration ` wxIMAGE_LIST_NORMAL'
c:/Programme/MinGW/Include/wx/msw/imaglist.h:44: error: conflicting declaration 'wxIMAGE_LIST_SMALL'
c:/Programme/MinGW/Include/wx/generic/imaglist.h:48: error: 'wxIMAGE_LIST_SMALL' has a previous declaration as ` wxIMAGE_LIST_SMALL'
c:/Programme/MinGW/Include/wx/msw/imaglist.h:44: error: declaration of `wxIMAGE_LIST_SMALL'
c:/Programme/MinGW/Include/wx/generic/imaglist.h:48: error: conflicts with previous declaration ` wxIMAGE_LIST_SMALL'
c:/Programme/MinGW/Include/wx/msw/imaglist.h:46: error: conflicting declaration 'wxIMAGE_LIST_STATE'
c:/Programme/MinGW/Include/wx/generic/imaglist.h:50: error: 'wxIMAGE_LIST_STATE' has a previous declaration as ` wxIMAGE_LIST_STATE'
c:/Programme/MinGW/Include/wx/msw/imaglist.h:46: error: declaration of `wxIMAGE_LIST_STATE'
c:/Programme/MinGW/Include/wx/generic/imaglist.h:50: error: conflicts with previous declaration ` wxIMAGE_LIST_STATE'
In file included from src/MuleListCtrl.cpp:38:
src/MuleListCtrl.h:71: error: expected class-name before '{' token
src/MuleListCtrl.cpp:60: error: `MuleExtern::wxListCtrl' has not been declared
src/MuleListCtrl.cpp: In constructor `CMuleListCtrl::CMuleListCtrl(wxWindow*, wxWindowID, const wxPoint&, const wxSize&, long int, const wxValidator&, const wxString&)':
src/MuleListCtrl.cpp:68: error: expected class-name before '(' token
src/MuleListCtrl.cpp:81: error: `SetImageList' undeclared (first use this function)
src/MuleListCtrl.cpp:81: error: (Each undeclared identifier is reported only once for each function it appears in.)
src/MuleListCtrl.cpp: In destructor `virtual CMuleListCtrl::~CMuleListCtrl()':
src/MuleListCtrl.cpp:92: error: `GetImageList' undeclared (first use this function)
src/MuleListCtrl.cpp: In member function `virtual void CMuleListCtrl::SaveSettings()':
src/MuleListCtrl.cpp:122: error: `GetColumnCount' undeclared (first use this function)
src/MuleListCtrl.cpp:125: error: `GetColumnWidth' undeclared (first use this function)
src/MuleListCtrl.cpp: In member function `virtual void CMuleListCtrl::LoadSettings()':
src/MuleListCtrl.cpp:177: error: `GetColumnCount' undeclared (first use this function)
src/MuleListCtrl.cpp:178: error: `SetColumnWidth' undeclared (first use this function)
src/MuleListCtrl.cpp: In member function `long int CMuleListCtrl::GetInsertPos(long int)':
src/MuleListCtrl.cpp:194: error: `GetItemCount' undeclared (first use this function)
src/MuleListCtrl.cpp:214: error: `GetItemData' undeclared (first use this function)
src/MuleListCtrl.cpp: In member function `virtual void CMuleListCtrl::SortList()':
src/MuleListCtrl.cpp:250: error: `SortItems' undeclared (first use this function)
src/MuleListCtrl.cpp: In member function `std::vector > CMuleListCtrl::GetSelectedItems() const':
src/MuleListCtrl.cpp:257: error: `GetSelectedItemCount' undeclared (first use this function)
src/MuleListCtrl.cpp:262: error: `GetNextItem' undeclared (first use this function)
src/MuleListCtrl.cpp:266: error: `GetItemData' undeclared (first use this function)
src/MuleListCtrl.cpp: In member function `void CMuleListCtrl::OnColumnRClick(wxListEvent&)':
src/MuleListCtrl.cpp:280: error: `GetColumnCount' undeclared (first use this function)
src/MuleListCtrl.cpp:281: error: `GetColumn' undeclared (first use this function)
src/MuleListCtrl.cpp:285: error: `GetColumnWidth' undeclared (first use this function)
src/MuleListCtrl.cpp:288: error: `PopupMenu' undeclared (first use this function)
src/MuleListCtrl.cpp: In member function `void CMuleListCtrl::OnMenuSelected(wxCommandEvent&)':
src/MuleListCtrl.cpp:298: error: `GetColumnWidth' undeclared (first use this function)
src/MuleListCtrl.cpp:299: error: `SetColumnWidth' undeclared (first use this function)
src/MuleListCtrl.cpp: In member function `void CMuleListCtrl::OnColumnLClick(wxListEvent&)':
src/MuleListCtrl.cpp:313: error: `GetNextItem' undeclared (first use this function)
src/MuleListCtrl.cpp:316: error: `GetItemData' undeclared (first use this function)
src/MuleListCtrl.cpp:340: error: `FindItem' undeclared (first use this function)
src/MuleListCtrl.cpp:342: error: `SetItemState' undeclared (first use this function)
src/MuleListCtrl.cpp: In member function `void CMuleListCtrl::SetColumnImage(int, int)':
src/MuleListCtrl.cpp:447: error: `SetColumn' undeclared (first use this function)
src/MuleListCtrl.cpp: In member function `long int CMuleListCtrl::CheckSelection(wxMouseEvent&)':
src/MuleListCtrl.cpp:453: error: `HitTest' undeclared (first use this function)
src/MuleListCtrl.cpp:455: error: `GetItemState' undeclared (first use this function)
src/MuleListCtrl.cpp:456: error: `GetNextItem' undeclared (first use this function)
src/MuleListCtrl.cpp:459: error: `SetItemState' undeclared (first use this function)
The changed part of my "MuleListCtrl.h" looks like this:
#include
#include "extern/listctrl.242.h"
#define wxLC_OWNERDRAW 0
#include
class CMuleListCtrl : public MuleExtern::wxListCtrl
{
public:
/**
* Constructor.
*
* @see wxListCtrl::wxListCtrl for documentation of parameters.
*/
CMuleListCtrl(
etc.
.
.
I'm still stuck here. Any more ideas?
-
Yes. Wait till one of the devs has taken the time to sort out the problems. :P
-
The problem is, that on MSW wx uses the native listctrl by default. You can override this if you use the universal widget set (configure wx with --with-msw --enable-universal --disable-debugreport <-- this is needed because of a bug in wx), and in MuleListCtrl.h & MuleListCtrl.cpp you need to change the
#ifdef __WXMSW__
lines to
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
This should work ... but it doesn't, at least for me. The MinGW compiler fails to understand correctly the MuleExtern:: namespace, and so it doesn't compile.
I have already created a "namespace-free" version of the patched listcontrol and tried it out, but, unsurprisingly, it doesn't work well... (At least much better then the unpathced native one).
So, it just seems to me that you have to wait until I can patch the native listcontol to use owner-drawn items... :(
-
I see, that's why I had the problem with undeclared MuleExtern::xxxx objects. Well, if you already claim that the source code changes that should work refuse to, I'll not try it myself and just wait, until you patched the native listctrl.
Thanks for the info!
-
What's up with the windows adapted build? Still no developer industrious enough?
Greets,
Sethur
-
I'll take a look at it later today or tomorrow.
-
At last, i was able to compile version 2.0.0 final using wxMSW 2.6.0. Thanks for all your efforts.
By the way, it didn't compile with wxMSW 2.4.2 (I think some funktion regarding the tray icon expected a different argument). Perhaps you should adapt you configure script to not accept version 2.4.2 any more.
-
Agreed, the same goes for Mac also.
-
And for linux