Error trying to build capsimage.library for MorphOS
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Jeckel
    Posts: 133 from 2007/3/11
    Hey!

    I'm trying to build the capsimage library as a shared library for MorphOS:
    http://forum.kryoflux.com/viewtopic.php?p=7624#p7624

    After some minor fixes, I was able to compile everything using gcc 2.95.3 from the MorphOS SDK.
    But I have a problem at the link stage:

    /gg/ppc-morphos/bin/ld: CAPSImg/CapsAPI.o: The target (__default_alloc_template<false, 0>::_S_free_list) of a R_PPC_MORPHOS_DREL_HA relocation is in the wrong section (.gnu.linkonce.d._t24__default_alloc_template2b0i0._S_free_list)
    /gg/ppc-morphos/bin/ld: CAPSImg/CapsAPI.o: The target (__default_alloc_template<false, 0>::_S_free_list) of a R_PPC_MORPHOS_DREL_LO relocation is in the wrong section (.gnu.linkonce.d._t24__default_alloc_template2b0i0._S_free_list)
    /gg/ppc-morphos/bin/ld: final link failed: Bad value
    collect2: ld returned 1 exit status
    make: *** [capsimage.library.elf] Error 1

    What did I do wrong?

    I created my library structure from the skeleton examples of the SDK.

    Edit: got it! I hate C++ :)
  • »02.07.14 - 18:24
    Profile
  • MorphOS Developer
    CISC
    Posts: 619 from 2005/8/27
    From: the land with ...
    You seem to be compiling with baserel, but not linking with it (ie, trying to link with mismatching libraries).


    - CISC
  • »03.07.14 - 04:58
    Profile
  • Acolyte of the Butterfly
    Acolyte of the Butterfly
    Jeckel
    Posts: 133 from 2007/3/11
    @CISC: I did some tries with your remark in mind but with no result unfortunatly.

    The API exposed by the library is C based but most of its internals are C++.
    Could my problem be related to the C++ templates they are using in the code?
    Of course it also requires libnix; that's the reason why I started with the nixskeleton example from the SDK; this part seems ok.

    No clue at this stage.

    Edit: I replaced the code relying on vectors by basic arrays and now it linked properly. Maybe I miss something to be able to use vectors?

    [ Edited by Jeckel 05.07.2014 - 09:23 ]
  • »04.07.14 - 19:49
    Profile