# SDL_stretch & MinGW

I do not arrive to compile SDL_stretch, I do not obtain any DLL:
libtool: link: warning: undefined symbols not allowed in i686-PC-mingw32
shared libraries c:\MinGW\bin\make.exe[2 ]: Leaving directory `d:/SDL_stretch-0.2.3 ' make[1 ]: Leaving directory` d:/SDL_stretch-0.2.3 ’

However I obtain SDL_stretch.a but that doesn’t work.
At the compile time of my program, I have an error:
D:/Dev-Cpp/sdlStretch/main.c:82: undefined reference to
`SDL_StretchSurfaceBlit(SDL_Surface*, SDL_Rect*, SDL_Surface*, SDL_Rect*)'
collect2: ld returned 1 exit status

The library is well added to the project.

Thus if somebody could give me the DLL already compiled
that would be a pleasure.

Thank you very much

napnap <napnap free.fr> writes:

I do not arrive to compile SDL_stretch, I do not obtain any DLL:
libtool: link: warning: undefined symbols not allowed in i686-PC-mingw32
shared libraries c:\MinGW\bin\make.exe[2 ]: Leaving directory `d:/SDL_stretch-0.2.3 ' make[1 ]: Leaving directory` d:/SDL_stretch-0.2.3 ’

However I obtain SDL_stretch.a but that doesn’t work.
At the compile time of my program, I have an error:
D:/Dev-Cpp/sdlStretch/main.c:82: undefined reference to
`SDL_StretchSurfaceBlit(SDL_Surface*, SDL_Rect*, SDL_Surface*, SDL_Rect*)'
collect2: ld returned 1 exit status

The library is well added to the project.

Thus if somebody could give me the DLL already compiled
that would be a pleasure.

Thank you very much

Extract on the web :===============================
Hi the header file for SDL_stretch is not very well written. It doesn’t assume
you might use C++, just C. You have to edit it as follows:

vim /usr/include/SDL_stretch/SDL_stretch.h

just before the function prototypes add:

#ifdef __cplusplus
extern “C” {
#endif

and then before the #endif on the very end of the file:

#ifdef __cplusplus
}
#endif

# This works for me.

After that, I’ve deleted all SDL_SetError(****) in the lib because this function
generate linking error (for me).

Then I could use this lib,with SDL_StretchSurfaceRect, but the result is not
good because the image displayed on my surface is not well recut, only the
quarter of its width is resized…without good reason…I think :

SDL_Surface *screen, *image;

SDL_Rect dstrect;
dstrect.x=0;
dstrect.y=0;
dstrect.h=image->h;
dstrect.w=image->w;

SDL_Rect dstrect2;
dstrect2.x=0;
dstrect2.y=0;
dstrect.h=screen->h;
dstrect.w=screen->w;
SDL_StretchSurfaceRect(image,&dstrect, screen,&dstrect2);

Normally, the image should be displayed on all the screen…

Good bye.