CTorrent
  • Caterpillar
    Caterpillar
    Roland
    Posts: 36 from 2013/2/10
    I Excuse the newbie question. This is me starting to work with the Morphos SDK. I decided to recompile CTorrent with the news Morphos SDK and ofcourse ran in to some problems. The first error is that the configure file looks for files that are not in the openssl directory of Morphos. After renaming that file, configure made a makefile.

    Running Make revealed a lot of missing header files, that I had to copy from the latest openssl version I could find on aminet. Now the compiler complains about a more technical issue
    ### current directory has changed to:


    Work:ctorrent-1.3.4
    /Work/ctorrent-1.3.4/GG:bin/make all-am
    make[1]: Entering directory `/Work/ctorrent-1.3.4'
    source='btstream.cpp' object='btstream.o' libtool=no \
    depfile='.deps/btstream.Po' tmpdepfile='.deps/btstream.TPo' \
    depmode=gcc /bin/sh ./depcomp \
    g++ -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c -o btstream.o `test -f 'btstream.cpp' || echo './'`btstream.cpp
    In file included from btstream.cpp:1:
    /gg/include/arpa/inet.h:49: `u_long' was not declared in this scope
    /gg/include/arpa/inet.h:49: `u_long' was not declared in this scope
    /gg/include/arpa/inet.h:49: variable `struct in_addr inet_makeaddr' has initializer but incomplete type
    /gg/include/arpa/inet.h:49: aggregate `{error} inet_makeaddr' has incomplete type and cannot be initialized
    make[1]: *** [btstream.o] Error 1
    make[1]: Leaving directory `/Work/ctorrent-1.3.4'
    make: *** [all] Error 2

    The code it refers to looks like this

    #ifndef _INET_H_
    #define _INET_H_

    /* External definitions for functions in inet(3) */

    #include <sys/cdefs.h>

    __BEGIN_DECLS
    unsigned long inet_addr __P((const char *));
    int inet_aton __P((const char *, struct in_addr *));
    unsigned long inet_lnaof __P((struct in_addr));
    struct in_addr inet_makeaddr __P((u_long, u_long));
    unsigned long inet_netof __P((struct in_addr));
    unsigned long inet_network __P((const char *));
    char *inet_ntoa __P((struct in_addr));
    __END_DECLS

    #endif /* !_INET_H_ */

    It looks like this part of the code comes from the SDK itself and I am not going to change anything in that breaking who knows what. Anyone have a solution? Thanks!
  • »24.05.13 - 12:34
    Profile
  • Butterfly
    Butterfly
    dekanyz
    Posts: 94 from 2013/2/6
    From: Hungary
    Maybe SDK should be checked a bit more carefully.
    I've found some not compiling code in examples... some documents what are impossible to open.


    [ Edited by dekanyz 24.05.2013 - 16:12 ]
  • »24.05.13 - 14:11
    Profile
  • Fab
  • MorphOS Developer
    Fab
    Posts: 1331 from 2003/6/16
    Remember the SDK doesn't claim to have full POSIX compatibility...

    It's the *MorphOS* SDK, and inevitably, generic posix/linux sources will sometimes have to be adapted to compile and work.

    @Roland

    First, avoid using ixemul if possible (add -noixemul as compiler and linker option).
    Then, if u_long is not defined, define it yourself in a relevant place.

    [ Edited by Fab 24.05.2013 - 16:57 ]
  • »24.05.13 - 14:50
    Profile Visit Website