libjpeg problem (bitte löschen, sorry für doppel post)
-
Ich habe kürzlich die libjpeg der ijg installiert und wollte einen Testlauf machen. Jedoch stürzt das Programm ab. Hier ist der 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; }
Debuggen ergab, dass das Programm bei "jpeg_start_compress(&cinfo, TRUE);" abstürzt.
Ich arbeite mit mingw und eclipse ganymede. Ich habe die libraries jpeg, libgsl, libgslcblas und libjpeg mitgelinkt (-l). Jedoch kann ich jpeg-bcc.lib nicht linken, denn beim builden bekomme ich immer folgende Fehlermeldung:
GnuWin32\lib/jpeg-bcc.lib: file not recognized: File format not recognized
collect2: ld returned 1 exit status
Build error occurred, build is stoppedIch hoffe jemand kann mir helfen.