Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
69 user(s) are online (48 user(s) are browsing Forums)

Members: 1
Guests: 68

kas1e, more...

Headlines

Forum Index


Board index » All Posts (MisterJBAM)




Re: A1222+ and Enhancer 2.2 Question
Just popping in
Just popping in


I have exactly the same problem with my 1222
I reported this to my seller and to amisphere for several weeks but 0 responses...

Go to top


Re: SDL2_image on A1222
Just popping in
Just popping in


@jabirulo

Thanks, I'll take the time to look at that and repeat tests

@walkero

Quote:
There is GCC 8, 10, 11 and 6 for SPE compatibility (A1222).


thanks for the info, I will correct that

Go to top


Re: SDL2_image on A1222
Just popping in
Just popping in


@jabirulo

Quote:
path of such files (.a/.so)?


SDK:local/newlib/lib

I tried what you gave me but to no avail.
could you please share an entire makefile?

@walkero

GCC 4.2.4 was installed by default (maybe with Cubic), is there a more recent version?

@Raziel

I'm starting to realize these problems

Go to top


Re: SDL2_image on A1222
Just popping in
Just popping in


@trixie
The problem is that they are well installed.

I used autoinstall and they are well in SDK:local

so I don't understand why it doesn't work

Go to top


SDL2_image on A1222
Just popping in
Just popping in


Hello

Having always been on Amiga Classic, I finally took the Amiga-NG step by getting an A1222 (I am a AOS4.1 beginner)

Wanting to take advantage of the power of this one, I would like to develop in SDL2 on it and I must admit that I am having a little trouble setting this up (this is different from Windows).
I'm currently stuck with SDL Image

For information :
- I use Cubic IDE for dev
- I installed sdk 54.16
- I use GCC 4.2.4
- I installed SDL2
- I also installed libSDL2_image, libSDL2_ttf, libjpeg, libwebp, libiff, libsmpeg2, libsdl2_net, libsdl2_mixer, libsdl2_gfx each time using the Autoinstall

It works correctly to compile in C and SDL2, but error for the SDL_image

Here is my code (which works on windows)

#include 
#include 
#include 
#include 

#define SDL_ASSERT_LEVEL 2

int test 1;

SDL_Texture *LoadTexture(SDL_Renderer *rendererchar *path)
{
    
SDL_Texture *texture NULL;

    
texture IMG_LoadTexture(rendererpath);
    if (
texture == NULL)
    {
        
printf("Unable to create texture from %s! SDL Error: %s\n"pathSDL_GetError());
        return 
NULL;
    }

    return 
texture;
}

int main(int argcchar *argv[])
{
    
setvbuf(stdoutNULL_IONBF0);

    
printf("Start\n");
#ifdef DEBUG
    
printf("Debug mode\n");
#endif

    
int iGameWidth 1024iGameHeight 768;

    if (
SDL_Init(SDL_INIT_EVERYTHING) != 0)
    {
        
printf("Failed to initialise SDL\n");
        return -
1;
    }

    
SDL_Window *window SDL_CreateWindow("A1222 - test SDL2 by JBAM",
                                          
SDL_WINDOWPOS_UNDEFINED,
                                          
SDL_WINDOWPOS_UNDEFINED,
                                          
iGameWidth,
                                          
iGameHeight,
                                          
SDL_WINDOW_SHOWN);

    if (
window == NULL)
    {
        
SDL_Log("Could not create a window: %s"SDL_GetError());
        return -
1;
    }

    
SDL_Renderer *renderer SDL_CreateRenderer(window, -1SDL_RENDERER_ACCELERATED SDL_RENDERER_PRESENTVSYNC);
    if (
renderer == NULL)
    {
        
SDL_Log("Could not create a renderer: %s"SDL_GetError());
        return -
1;
    }
    else
    {
        
int imgFlags IMG_INIT_PNG IMG_INIT_JPG;
        if (!(
IMG_Init(imgFlags) & imgFlags))
        {
            
printf("SDL_image could not initialize! SDL_image Error: %s\n"IMG_GetError());
            return -
1;
        }
    }

    
// fond
    
SDL_Texture *texFond;
    
texFond LoadTexture(renderer"gfx/fond.png");
    
SDL_QueryTexture(texFondNULLNULL00);

    
// boingball
    
SDL_Texture *texBoingBall;
    
int iTexBoingBall_wiTexBoingBall_h;
    
float iTexBoingBall_x 0iTexBoingBall_y 0iTexBoingBall_vx 4iTexBoingBall_vy 4;
    
texBoingBall LoadTexture(renderer"gfx/boingball.png");
    
SDL_QueryTexture(texBoingBallNULLNULL, &iTexBoingBall_w, &iTexBoingBall_h);

    
// GAME LOOP

    
while (test == 1)
    {
        
SDL_Event event;
        if (
SDL_PollEvent(&event))
        {
            if (
event.type == SDL_QUIT)
            {
                
test 0;
                break;
            }
        }

        
iTexBoingBall_x += iTexBoingBall_vx;
        
iTexBoingBall_y += iTexBoingBall_vy;

        if (
iTexBoingBall_x iTexBoingBall_w iGameWidth)
        {
            
iTexBoingBall_vx = -iTexBoingBall_vx;
            
iTexBoingBall_x iGameWidth iTexBoingBall_w;
        }
        if (
iTexBoingBall_x  iGameHeight)
        {
            
iTexBoingBall_vy = -iTexBoingBall_vy;
            
iTexBoingBall_y iGameHeight iTexBoingBall_h;
        }
        if (
iTexBoingBall_y 0)
        {
            
iTexBoingBall_vy = -iTexBoingBall_vy;
            
iTexBoingBall_y 0;
        }

        
// Efface l'écran
        
SDL_RenderClear(renderer);

        
// dessine le fond
        
SDL_Rect rectDestFond = {001024768};
        
SDL_RenderCopy(renderertexFondNULL, &rectDestFond);

        
// Dessine la BoingBall
        
SDL_Rect rectDestBoingBall = {iTexBoingBall_xiTexBoingBall_yiTexBoingBall_wiTexBoingBall_h};
        
SDL_RenderCopy(renderertexBoingBallNULL, &rectDestBoingBall);

        
// Présente l'écran
        
SDL_RenderPresent(renderer);
    }

    
SDL_DestroyRenderer(renderer);
    
SDL_DestroyWindow(window);
    
SDL_DestroyTexture(texBoingBall);
    
IMG_Quit();
    
SDL_Quit();

    return 
0;
}



here is my makefile

EXE    bin/gcc-amigaos4-latest/Boing-ball
OBJDIR 
o/gcc-amigaos4-latest/
SDK_PATH SDK:local/newlib/

CC gcc
LD
gcc
CXXFLAGS
=  -Wall -O2 -I$(SDK_PATH)include -I$(SDK_PATH)include/SDL2 

all 
: $(EXE)

$(
OBJDIR)main.main.c
    
$(CC) $(shell gccprefs) -$(CXXFLAGS) -o  $(OBJDIR)main.o main.c

    
OBJS 
= $(OBJDIR)main.o

$(EXE) : $(OBJS)
    $(
LD) $(CXXFLAGS) $(OBJS) -lSDL2 -lSDL2_image -LSDL2_ttf $(shell gccprefs) -$(EXE)

strip:
    
strip --remove-section=.comment $(EXE)

clean:
    -
delete $(EXE)
    -
delete $(OBJDIR)\*.o



and here is the error I got

gcc -Wall -O2 -ISDK:local/newlib/include -ISDK:local/newlib/include/SDL2  o/gcc-amigaos4-latest/main.-lSDL2 -lSDL2_image -LSDL2_ttf -lauto -o bin/gcc-amigaos4-latest/Boing-ball
/SDK/local/newlib/lib/libSDL2_image.a(libSDL2_image_la-IMG_tif.o): In function `IMG_LoadTIF_RW':
/home/michael/SDL2_image-2.8.2/src/IMG_tif.c:173: undefined reference to 
`TIFFClientOpen'
/home/michael/SDL2_image-2.8.2/src/IMG_tif.c:179: undefined reference to `TIFFGetField'
/home/michael/SDL2_image-2.8.2/src/IMG_tif.c:180undefined reference to `TIFFGetField'
/home/michael/SDL2_image-2.8.2/src/IMG_tif.c:186: undefined reference to 
`TIFFReadRGBAImageOriented'
/home/michael/SDL2_image-2.8.2/src/IMG_tif.c:199: undefined reference to `TIFFClose'
/home/michael/SDL2_image-2.8.2/src/IMG_tif.c:189undefined reference to `TIFFClose'
/SDK/local/newlib/lib/libSDL2_image.a(libSDL2_image_la-IMG_webp.o): In function 
`IMG_LoadWEBP_RW':
/home/michael/SDL2_image-2.8.2/src/IMG_webp.c:199: undefined reference to `WebPGetFeaturesInternal'
/home/michael/SDL2_image-2.8.2/src/IMG_webp.c:217undefined reference to `WebPDecodeRGBAInto'
/home/michael/SDL2_image-2.8.2/src/IMG_webp.c:219: undefined reference to 
`WebPDecodeRGBInto'
/SDK/local/newlib/lib/libSDL2_image.a(libSDL2_image_la-IMG_webp.o): In function `IMG_LoadWEBPAnimation_RW'
:
/
home/michael/SDL2_image-2.8.2/src/IMG_webp.c:294undefined reference to `WebPGetFeaturesInternal'
/home/michael/SDL2_image-2.8.2/src/IMG_webp.c:307: undefined reference to 
`WebPDemuxInternal'
/home/michael/SDL2_image-2.8.2/src/IMG_webp.c:311: undefined reference to `WebPDemuxGetI'
/home/michael/SDL2_image-2.8.2/src/IMG_webp.c:327undefined reference to `WebPDecodeRGBAInto'
/home/michael/SDL2_image-2.8.2/src/IMG_webp.c:316: undefined reference to 
`WebPDemuxGetFrame'
/home/michael/SDL2_image-2.8.2/src/IMG_webp.c:334: undefined reference to `WebPDecodeRGBInto'
/home/michael/SDL2_image-2.8.2/src/IMG_webp.c:357undefined reference to `WebPDemuxDelete'
/home/michael/SDL2_image-2.8.2/src/IMG_webp.c:345: undefined reference to 
`WebPDemuxDelete'
make: *** [bin/gcc-amigaos4-latest/Boing-ball] Error 1
Done.


Thanking you for the help you can give me

Go to top



TopTop




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project