Page 6 of 9 FirstFirst ... 45678 ... LastLast
Results 51 to 60 of 81

Thread: FPC4GP2X status?

  1. #51

    FPC4GP2X status?

    Apparently you have to link in some libraries. Seems at least libstdc++ and some kind of library related to Ogg Vorbis.

  2. #52

    FPC4GP2X status?

    Can you link directly to the *.a file without the need for the .cpp?
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  3. #53

    FPC4GP2X status?

    Yes, you can.

    If the amount of dependencies is high I would consider to dlopen the library rather than linking to it; since a high number of direct dependencies makes you vulnerable to incompatibilities versions between those libraries.

  4. #54

    FPC4GP2X status?

    [quote="dmantione"]Apparently you have to ]

    If it helps, I have a makefile for a C code demo that compiles using the devkitGP2X which uses most of the SDL libs including SDL_mixer...

    Code:
    CROSS_COMPILE = C&#58;/devkitGP2X/bin/arm-linux-
    SDL_BASE = C&#58;/devkitGP2X/bin/arm-linux-
    LDFLAGS = -static
    
    CXX = $&#40;CROSS_COMPILE&#41;g++
    STRIP = $&#40;CROSS_COMPILE&#41;strip
    
    CXXFLAGS = -I"C&#58;/devkitGP2X/include" -I"C&#58;/devkitGP2X/include/SDL" -DTARGET_GP2X -O2 -Wall
    LIBS = -L"C&#58;/devkitGP2X/lib" -lSDL -lSDL_gfx --start-group -lSDL_ttf -lfreetype -lSDL --end-group -lSDL_image -ljpeg -lpng12 -lz --start-group -lSDL_mixer -lvorbisidec -lmikmod -lsmpeg -lSDL --end-group -lgcc -lm -lc -lexpat -lpthread -ldl
    
    TARGET = sdltest.gpe
    OBJS = sdltest.o
    
    ALL_TARGETS = $&#40;TARGET&#41;
    
    all&#58; $&#40;ALL_TARGETS&#41;
    
    $&#40;TARGET&#41;&#58; $&#40;OBJS&#41;
    		$&#40;CXX&#41; $&#40;LDFLAGS&#41; -o $&#40;TARGET&#41; $&#40;OBJS&#41; $&#40;LIBS&#41;
    		$&#40;STRIP&#41; $&#40;TARGET&#41;
    
    clean&#58;
    		rm *.o
    		rm $&#40;TARGET&#41;
    So I assume I already have all the libs I need...I must not be linking correctly or something

    cheers,
    Paul

  5. #55

    FPC4GP2X status?

    Yes, you might have them, but did you $linklib them?

  6. #56

    FPC4GP2X status?

    [quote="dmantione"]Yes, you might have them, but did you $]

    I assume I would use $linklib in the .pas file?

    I already do this for my own c library:

    Code:
    &#123;$link gp2x_sdl_mixer_c.o&#125;
    &#123;$linklib c&#125;
    How would I use $linklib for other libraries to this as well?

    cheers,
    Paul

  7. #57

    FPC4GP2X status?

    Maybe something like

    Code:
    &#123;$linklib smpeg&#125;
    inside the smpeg.pas unit, and similar directives in the other units.
    <br /><br />There are a lot of people who are dead while they are still alive. I want to be alive until the day I die.<br />-= Paulo Coelho =-

  8. #58

    FPC4GP2X status?

    Quote Originally Posted by savage
    Maybe something like

    [code]&#123;$]

    inside the smpeg.pas unit, and similar directives in the other units.
    I have tried adding that and similar into the gp2x_sdl_mixer.pas but to no avail

    I am trying to get around using the smpeg.pas and sdl_mixer.pas units as a test and use the c library (gp2x_sdl_mixer_c.o) instead via the gp2x_sdl_mixer.pas file.

    cheers,
    Pau;

  9. #59

    FPC4GP2X status?

    For nds I use static linking in this way:

    [pascal]{$linklib libsmpeg.a}[/pascal]

    Of course I added the path of these libs on my fpc.cfg

    Code:
    -FlE&#58;\devkitpro\libnds\lib
    -FlE&#58;\devkitpro\devkitARM\lib\gcc\arm-eabi\4.1.2
    -FlE&#58;\devkitpro\devkitARM\lib\gcc\arm-eabi\4.1.2\thumb
    -FlE&#58;\devkitpro\devkitARM\arm-eabi\lib
    -FlE&#58;\devkitpro\devkitARM\arm-eabi\lib\thumb
    Some times I need to link some other libs, like

    [pascal]{$linklib libc.a}
    {$linklib libgcc.a}
    {$linklib libsysbase.a}[/pascal]

    and never had problems.
    I hope it could do the trick on gp2x too
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  10. #60

    FPC4GP2X status?

    Thanks for the info Legolas, I will try this :-)
    cheers,
    Paul

Page 6 of 9 FirstFirst ... 45678 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •