I've just installed the ijg jpeg library and wanted to give it a try. But for some reasons it crashes.
Here is my code:

/*
* test.cpp
*
* Created on: 10.12.2008
*
*/

#include<iostream>
#include<stdlib.h>

using namespace std;

#include <jconfig.h>
#include <jerror.h>
#include <jmorecfg.h>
#include <jpeglib.h>

int main()
{
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;

JSAMPLE image[800];
int i;
for(i=0;i<800;i++)
{
//image[i]=char(i%50);
}

cinfo.err = jpeg_std_error(&jerr);
jpeg_create_compress(&cinfo);

cinfo.image_width = 800; /* image width and height, in pixels */
cinfo.image_height = 600;
cinfo.input_components = 1; /* # of color components per pixel */
cinfo.in_color_space = JCS_GRAYSCALE; /* colorspace of input image */

jpeg_set_defaults(&cinfo);

jpeg_start_compress(&cinfo, TRUE);

JSAMPROW row_pointer[1];
int row_stride;
row_stride = 800;

while (cinfo.next_scanline < cinfo.image_height)
{
row_pointer[0] = & image[0];
jpeg_write_scanlines(&cinfo, row_pointer, 1);
}

jpeg_finish_compress(&cinfo);

return 0;
}

By debugging, I found out, that it crashes at "jpeg_start_compress(&cinfo, TRUE);".

I'm using mingw with eclipse ganimede under windows vista. I linked (-l) jpeg, libgsl, libgslcblas and libjpeg. I can't link jpeg-bcc.lib. When I try to do so, I get an error:

GnuWin32\lib/jpeg-bcc.lib: file not recognized: File format not recognized
collect2: ld returned 1 exit status
Build error occurred, build is stopped

I hope anyone can help me with it.