aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Errors compiling on Mac OS X  (Read 5836 times)

Puck Lock

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 5
Errors compiling on Mac OS X
« on: October 14, 2003, 08:12:51 PM »

I tried to compile this on Mac OS X 10.2.6, with Dec2002 Developer Tools and a current Fink install with gtk+-1.2.10, gtk+-2.2.1, and wxgtk-2.4.1.2-2. I'm a total newbie at this, so if someone could help fixing these compile errors just to see if this really even works. Tried to compile amule 1.08:

my config script was
./configure --prefix=/sw --infodir=/sw/share/info

1st error:

if g++ -DHAVE_CONFIG_H -I. -I. -I..   -I/sw/include  -g   -I/sw/lib/wx/include/gtkd-2.4 -I/sw/include -D__WXDEBUG__ -D__WXGTK__ -DWXMAKINGDLL -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -I/sw/include/gtk-1.2 -I/sw/include/glib-1.2 -I/sw/lib/glib/include -I/usr/X11R6/include -Isrc  -MT Preferences.o -MD -MP -MF ".deps/Preferences.Tpo" \
  -c -o Preferences.o `test -f 'Preferences.cpp' || echo './'`Preferences.cpp; \
then mv ".deps/Preferences.Tpo" ".deps/Preferences.Po"; \
else rm -f ".deps/Preferences.Tpo"; exit 1; \
fi
Preferences.cpp:57:1: warning: "MAX_PATH" redefined
In file included from Preferences.cpp:37:
Preferences.h:27:1: warning: this is the location of the previous definition
Preferences.cpp: In member function `void CPreferences::LoadPreferences()':
Preferences.cpp:997: `atoll' undeclared (first use this function)
Preferences.cpp:997: (Each undeclared identifier is reported only once for each
   function it appears in.)
make[3]: *** [Preferences.o] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

On Mac OS X, we don't have MAX_PATH, we do have PATH_MAX, so I changed MAX_PATH to PATH_MAX (in Preferences.cpp & .h, CatDialog.cpp, KnownFileList.cpp, PartFile.cpp); make again, then this minor error (which it compile right past, so I figured it was fixed)

then mv ".deps/CatDialog.Tpo" ".deps/CatDialog.Po"; \
else rm -f ".deps/CatDialog.Tpo"; exit 1; \
fi
In file included from ServerList.h:24,
                 from ServerListCtrl.h:4,
                 from sockets.h:27,
                 from amuleDlg.h:24,
                 from amule.h:30,
                 from CatDialog.cpp:23:
Preferences.h:27:1: warning: "PATH_MAX" redefined
In file included from /usr/include/limits.h:63,
                 from /sw/include/wx/debug.h:16,
                 from /sw/include/wx/defs.h:398,
                 from /sw/include/wx/list.h:36,
                 from mfc.h:7,
                 from wintypes.h:44,
                 from CatDialog.cpp:21:

then

Preferences.h:28:1: warning: "PATH_MAX" redefined
In file included from /usr/include/sys/param.h:88,
                 from Preferences.cpp:33:
/usr/include/sys/syslimits.h:73:1: warning: this is the location of the previous definition
Preferences.cpp:58:1: warning: "PATH_MAX" redefined
In file included from Preferences.cpp:37:
Preferences.h:28:1: warning: this is the location of the previous definition
Preferences.cpp: In constructor `CPreferences::CPreferences()':
Preferences.cpp:154: `PATH_MAX' undeclared (first use this function)
Preferences.cpp:154: (Each undeclared identifier is reported only once for each
   function it appears in.)
Preferences.cpp: In member function `void CPreferences::LoadPreferences()':
Preferences.cpp:998: `atoll' undeclared (first use this function)
make[3]: *** [Preferences.o] Error 1

pico /usr/include/stdlib.h shows no atoll; it does include
long     atol __P((const char *));
long     strtol __P((const char *, char **, int));
#ifndef __STRICT_ANSI__
long long
         strtoll(const char *, char **, int);
unsigned long long
         strtoull(const char *, char **, int);

changing atoll to strtoll had errors, so I couldn't get any further.
I saw a webpage that I said something like define atoll against strtoll like:
#define atoll(str) strtoll(str, (char **)NULL, 10)
but that gave me errors as well (well, my attempt failed because I didn't know how to implement it correctly—str was unimplemented or something).

Any help would be appreciated.
Logged

BigBob

  • aMule project creator.
  • Full Member
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 141
    • http://bigbob.fun.free.fr
Re: Errors compiling on Mac OS X
« Reply #1 on: October 15, 2003, 04:09:29 AM »

Hi,

To be honnest you have reached my limits about devel ...

I'm learning coding on aMule project and i must say i can't help you on this problem :-(

Maybe if a member can help porting aMule to Max OS X ???

A++
Logged
Creator of aMule & aStats projects

Puck Lock

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 5
Re: Errors compiling on Mac OS X
« Reply #2 on: October 15, 2003, 06:20:18 PM »

Things are a little better, but I REALLY get stuck at the SysTray.cpp. Lots of errors. However, since Mac OS X can't use anything like a SysTray (don't even have any idea of what it does), could a switch be added in the configure script to disable SysTray (at least on Macs)?

Progress so far:

Preferences.cpp & .h
changed MAX_PATH 2048 to
MAX_PATH 1024

/usr/include/sys/syslimits.h says 1024, so do I.

no atoll() function, strtoll() substitute
changed:
#ifdef __FreeBSD__
extern long long atoll(char *s);

to:
#if defined(BSD)
#define atoll(str) strtoq(str, (char **)NULL, 10)

compiled just fine up to the SysTray part. Some minor errors about MAX_PATH redefined (i.e.
ServerList.cpp:371:1: warning: "MAX_PATH" redefined
In file included from ServerList.h:24,
                 from ServerList.cpp:34:
Preferences.h:27:1: warning: this is the location of the previous definition).

I wouldn't even know where to fiddle with the configs. More googleing I will go. The ed2k_gui-gtk project added a switch to turn off SysTray, so I'll start there. Works perfectly from cvs.
Logged

BigBob

  • aMule project creator.
  • Full Member
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 141
    • http://bigbob.fun.free.fr
Re: Errors compiling on Mac OS X
« Reply #3 on: October 15, 2003, 10:58:36 PM »

Hi,

We have an IRC channel #aMule on EFNET IRC Network ...

If you want you can join ...

A++
Logged
Creator of aMule & aStats projects

Puck Lock

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 5
Re: Errors compiling on Mac OS X
« Reply #4 on: October 17, 2003, 03:47:19 PM »

Just giving an update.

After removing SysTray.cpp from /amule[version]/src/Makefile.am and then ./configure again, I got a new error compiling TabCtrl.cpp:

TabCtrl.h:10: storage size of `_ZTI13wxTabListNode' isn't known
TabCtrl.h:10: storage size of `_ZTI7TabList' isn't known
TabCtrl.h:19: storage size of `_ZTI9wxTabCtrl' isn't known

Added
TabCtrl.h
#if defined(__GNUG__) && !defined(__APPLE__)
    #pragma interface "TabCtrl.h"
#endif

TabCtrl.cpp
#ifdef __GNUG__
    #pragma implementation "TabCtrl.h"
#endif

got me to compile up to UDPSocket.cpp

UDPSocket.cpp: In member function `virtual void* AsyncDNS::Entry()':
UDPSocket.cpp:175: `gethostbyname_r' undeclared (first use this function)
UDPSocket.cpp:175: (Each undeclared identifier is reported only once for each
   function it appears in.)
make[3]: *** [UDPSocket.o] Error 1

/usr/include/netdb.h
struct hostent  *gethostbyname __P((const char *));
struct hostent  *gethostbyname2 __P((const char *, int));

Mac OS X doesn't have gethostbyname_r

Searching for a solution, I came across a page in MySQL where they found a workaround in their source (/mysql/sql/hostname.cc). They use:

hp=gethostbyaddr((char*) in,sizeof(*in), AF_INET)

By the way, as per Boa kicking me off for flooding when I posted my progress on #amule, perhaps you should change the REAME from "We welcome all contributions". Something like "Fix your problems yourself". 2 hours before my kick (in the ass) it wasn't a problem, so I assume the change was geared towards me. I can take a hint.
Logged

deltaHF

  • Evil Admin
  • Former Developer
  • Hero Member
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 3920
  • .. Legends may sleep, but they never die ..
    • http://www.amule.org
Re: Errors compiling on Mac OS X
« Reply #5 on: October 17, 2003, 04:23:07 PM »

Puck Lock, it was an Auto-Kick on flood ..

BigBob

  • aMule project creator.
  • Full Member
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 141
    • http://bigbob.fun.free.fr
Re: Errors compiling on Mac OS X
« Reply #6 on: October 17, 2003, 05:32:28 PM »

Hi Puck Lock,

1st of all really sorry for the kick, but you must know it's a normal behavior on IRC when a user flood the chan too quickly ...

When you are kicked you can just rejoin the channel by typing :

/join #aMule

Another way is to find an option in your IRC Client like "Auto rejoin on kick" or something like that.

Welll, concerning your problem about compilation break, maybe you can search for libresolve (look in bind for example "http://www.isc.org").

Be more patient please ... ;-)

Hope this help, and i'm waiting for you on IRC ...

A++
Logged
Creator of aMule & aStats projects

Puck Lock

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 5
Re: Errors compiling on Mac OS X
« Reply #7 on: October 17, 2003, 06:52:17 PM »

ok, got past UDPSocket.cpp:
changed
gethostbyname_r
to
gethostbyname

and
changed
#if defined(__linux__)
  gethostbyname (ipName.GetData(),&ret,dataBuf,sizeof(dataBuf),&result,&errorno);
#else
  result = gethostbyname (ipName.GetData());

------------------
WebServer.cpp:

added

#if defined(BSD)
#define atoll(str) strtoll(str, (char **)NULL, 10)
#endif /* __FreeBSD__ */

didn't clear up (new line numbers)
WebServer.cpp: In static member function `static bool
   CWebServer::IsSessionAdmin(ThreadData, wxString)':
WebServer.cpp:2266: `atoll' undeclared (first use this function)
WebServer.cpp:2266: (Each undeclared identifier is reported only once for each
   function it appears in.)

changed
long sessionID=atoll(SsessionID);
to
long long sessionID=strtoll(SsessionID, NULL, 10);

compile fine until the end:

WebServer.o WebSocket.o Wizard.o XBMDraw.o amule.o amuleDlg.o  -Lwx/xrc -lxrc  -L/sw/lib -L/sw/lib -lwx_gtkd-2.4 -lz
ld: archive: wx/xrc/libxrc.a has no table of contents, add one with ranlib(1) (can't load from it)
ld: warning multiple definitions of symbol wxSizeTCmpFn(unsigned long, unsigned long)
listctrl.o definition of wxSizeTCmpFn(unsigned long, unsigned long) in section (__TEXT,__text)
/sw/lib/libwx_gtkd-2.4.dylib(master.4889.o) definition of wxSizeTCmpFn(unsigned long, unsigned long)
ld: warning multiple definitions of symbol wxListTextCtrl::OnKillFocus(wxFocusEvent&)

[lots of messages like this following]

listctrl.o definition of _wxEVT_COMMAND_LIST_KEY_DOWN in section (__DATA,__data)
/sw/lib/libwx_gtkd-2.4.dylib(master.4889.o) definition of _wxEVT_COMMAND_LIST_KEY_DOWN
ld: warning multiple definitions of symbol _wxEVT_COMMAND_LIST_SET_INFO
listctrl.o definition of _wxEVT_COMMAND_LIST_SET_INFO in section (__DATA,__data)
/sw/lib/libwx_gtkd-2.4.dylib(master.4889.o) definition of _wxEVT_COMMAND_LIST_SET_INFO
make[3]: *** [amule] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Logged

Puck Lock

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 5
Re: Errors compiling on Mac OS X
« Reply #8 on: October 18, 2003, 02:18:55 AM »

Should have started with this link:

http://xmule.org/forums/index.php?showtopic=449&st=15&#entry4962

'Twould have saved time.
Logged

deltaHF

  • Evil Admin
  • Former Developer
  • Hero Member
  • *****
  • Karma: 6
  • Offline Offline
  • Posts: 3920
  • .. Legends may sleep, but they never die ..
    • http://www.amule.org
Re: Errors compiling on Mac OS X
« Reply #9 on: February 09, 2004, 06:27:15 PM »

Mac screenshot :



we r very close :)