Bonsoir;
j'ai developpé une application en visual c++ 2008 qui permet de dessiner une scène 3D à partir d'un fichier obj, je veux texturer les objets de la scène,
pour cela j'ai fait appel à la bibliothèque jpeglib pour charger l'image de texture.
j'ai trouvé des erreurs de link incompréhensible dans cette fonction:
les erreurs sont:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74 gl_texture_t * ReadJPEGFrom(const file_buffer_t *file) { gl_texture_t *texinfo = NULL; struct jpeg_decompress_struct cinfo; struct my_error_mgr jerr; struct jpeg_source_mgr jsrc; JSAMPROW j; int i; //create and configure decompress object jpeg_create_decompress (&cinfo); cinfo.err = jpeg_std_error (&jerr.pub); cinfo.src = &jsrc; //configure error manager jerr.pub.error_exit = err_exit; if (setjmp (jerr.setjmp_buffer)) { jpeg_destroy_decompress (&cinfo); if (texinfo) { if (texinfo->texels) free (texinfo->texels); free (texinfo); } return NULL; } //configure source manager jsrc.next_input_byte = file->data; jsrc.bytes_in_buffer = file->length; jsrc.init_source = mem_init_source; jsrc.fill_input_buffer = mem_fill_input_buffer; jsrc.skip_input_data = mem_skip_input_data; jsrc.resync_to_restart = jpeg_resync_to_restart; jsrc.term_source = mem_term_source; //read file's header and prepare for decompression jpeg_read_header (&cinfo, TRUE); jpeg_start_decompress (&cinfo); texinfo = (gl_texture_t *)malloc (sizeof (gl_texture_t)); texinfo->width = cinfo.image_width; texinfo->height = cinfo.image_height; texinfo->internalFormat = cinfo.num_components; texinfo->format = (cinfo.num_components == 1) ? GL_LUMINANCE : GL_RGB; texinfo->texels = (GLubyte *)malloc (sizeof (GLubyte) * texinfo->width * texinfo->height * texinfo->internalFormat); for (i = 0; i < texinfo->height; ++i) { #if 1 j = (texinfo->texels + ((texinfo->height - (i + 1)) * texinfo->width * texinfo->internalFormat)); #else j = &texinfo->texels[texinfo->width * i * texinfo->internalFormat]; #endif jpeg_read_scanlines (&cinfo, &j, 1); } jpeg_finish_decompress (&cinfo); jpeg_destroy_decompress (&cinfo); return texinfo; }
comment corrigé ces erreurs svp?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 1>texture.obj : error LNK2019: unresolved external symbol _jpeg_finish_decompress referenced in function "struct gl_texture_t * __cdecl ReadJPEGFrom(struct file_buffer_t const *)" (?ReadJPEGFrom@@YAPAUgl_texture_t@@PBUfile_buffer_t@@@Z) 1>texture.obj : error LNK2019: unresolved external symbol _jpeg_read_scanlines referenced in function "struct gl_texture_t * __cdecl ReadJPEGFrom(struct file_buffer_t const *)" (?ReadJPEGFrom@@YAPAUgl_texture_t@@PBUfile_buffer_t@@@Z) 1>texture.obj : error LNK2019: unresolved external symbol _jpeg_start_decompress referenced in function "struct gl_texture_t * __cdecl ReadJPEGFrom(struct file_buffer_t const *)" (?ReadJPEGFrom@@YAPAUgl_texture_t@@PBUfile_buffer_t@@@Z) 1>texture.obj : error LNK2019: unresolved external symbol _jpeg_read_header referenced in function "struct gl_texture_t * __cdecl ReadJPEGFrom(struct file_buffer_t const *)" (?ReadJPEGFrom@@YAPAUgl_texture_t@@PBUfile_buffer_t@@@Z) 1>texture.obj : error LNK2019: unresolved external symbol _jpeg_resync_to_restart referenced in function "struct gl_texture_t * __cdecl ReadJPEGFrom(struct file_buffer_t const *)" (?ReadJPEGFrom@@YAPAUgl_texture_t@@PBUfile_buffer_t@@@Z) 1>texture.obj : error LNK2019: unresolved external symbol _jpeg_destroy_decompress referenced in function "struct gl_texture_t * __cdecl ReadJPEGFrom(struct file_buffer_t const *)" (?ReadJPEGFrom@@YAPAUgl_texture_t@@PBUfile_buffer_t@@@Z) 1>texture.obj : error LNK2019: unresolved external symbol _jpeg_std_error referenced in function "struct gl_texture_t * __cdecl ReadJPEGFrom(struct file_buffer_t const *)" (?ReadJPEGFrom@@YAPAUgl_texture_t@@PBUfile_buffer_t@@@Z) 1>texture.obj : error LNK2019: unresolved external symbol _jpeg_CreateDecompress referenced in function "struct gl_texture_t * __cdecl ReadJPEGFrom(struct file_buffer_t const *)" (?ReadJPEGFrom@@YAPAUgl_texture_t@@PBUfile_buffer_t@@@Z)
merci d'avance.
Partager