Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

  1. #1
    Membre averti
    [DevIL API] Probleme d'erreur de compilation avec la lib DevIL
    Bonjour

    Mon but est de charger des images .dds pour texturer mes models 3D. En C et non en C++ (pour le moment)

    J'ai un soucis avec la librairie DevIL

    J'ai mis ca en include:
    #include <IL/il.h>
    #include <IL/ilu.h>
    #include <IL/ilut.h>
    //#include <IL/ilu_region.h>
    #include <IL/devil_internal_exports.h>
    J'ai bien linker les DevIL.lib, ULUT.lib et ILU.lib que j'ai placé dans le repertoire /lib de mon compilo, et quand je compile j'ai ces erreur:


    Project : SDL Application
    Compiler : GNU GCC Compiler (called directly)
    Directory : D:\CodeBlocks\MesProjets\Editor\
    --------------------------------------------------------------------------------
    Switching to target: default
    Compiling: main.c
    In file included from main.c:9:
    D:/CodeBlocks/include/IL/ilut.h:278: warning: "struct IDirect3DDevice8" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:278: warning: its scope is only this definition or declaration, which is probably not what you want
    D:/CodeBlocks/include/IL/ilut.h:279: warning: "struct IDirect3DDevice8" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:280: warning: "struct IDirect3DDevice8" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:281: warning: "struct IDirect3DDevice8" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:282: warning: "struct IDirect3DDevice8" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:283: warning: "struct IDirect3DDevice8" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:284: warning: "struct IDirect3DDevice8" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:285: warning: "struct IDirect3DDevice8" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:287: warning: "struct IDirect3DDevice8" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:288: warning: "struct IDirect3DDevice8" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:289: warning: "struct IDirect3DSurface8" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:289: warning: "struct IDirect3DDevice8" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:294: warning: "struct IDirect3DDevice9" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:295: warning: "struct IDirect3DDevice9" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:296: warning: "struct IDirect3DDevice9" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:298: warning: "struct IDirect3DDevice9" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:299: warning: "struct IDirect3DDevice9" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:300: warning: "struct IDirect3DDevice9" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:301: warning: "struct IDirect3DDevice9" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:303: warning: "struct IDirect3DDevice9" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:304: warning: "struct IDirect3DDevice9" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:305: warning: "struct IDirect3DDevice9" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:306: warning: "struct IDirect3DDevice9" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:307: warning: "struct IDirect3DDevice9" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:308: warning: "struct IDirect3DDevice9" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:311: warning: "struct IDirect3DDevice9" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:312: warning: "struct IDirect3DDevice9" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:313: warning: "struct IDirect3DSurface9" declared inside parameter list
    D:/CodeBlocks/include/IL/ilut.h:313: warning: "struct IDirect3DDevice9" declared inside parameter list
    Linking console executable: Editor.exe
    Process terminated with status 0 (0 minutes, 1 seconds)
    0 errors, 30 warnings


    J'ai renommer config.h.win en config.h car il disait qu'il ne trouvais pas config.h. Apparement, ce IDirect3DDevice8 est informé dans ce fichier mais je pige pas comment resoudre le pb.
    - J'utilise Code::Blocks RC1

    Sinon si vous avez un moyen d'ouvrire les .dds autrement et en langage C, je suis preneur

    Merci
    Le forum c'est trop génial

  2. #2
    Rédacteur

    Bizarre. A défaut de donner une solution, je ne suis pas sûr que tu aies besoin de ILUT juste pour charger une image, tout comme ILU d'ailleurs.
    IL suffira bien largement.

  3. #3
    Membre averti
    re

    Oui mais je veux afficher l'image dans ma fenetre OPenGL donc il me semble que j'ai besoin de ILUT (qui a besoin de ILU qui a besoin de IL il me semble), pas seulement la charger en memoire et faire des traitement dessus de facon "invisible"


    Je suis passé a "Code Blocks Nighly Build" donc les versions maj tous les jours. Ca me fait les memes messages. Par contre ca compile quand meme et je peux lancé l'executable sans probleme.

    Je ne sais pas si ca le faisait avec la version RC2, pensant que ca ne marchait pas. Enfin bref, je vais rester sur la version Nightly qui m'a l'air quand meme plus au point que la version RC2.

    Mais j'aimerai bien qu'il ne m'affiche plus ces messages quand je compile, ca fit pas très "propres"

    merci


    EDIT:
    Bon j'ai ouvert le fichier "ilut.h" et j'ai mis en commentaire les blocs suivant:


    /*
    // ImageLib Utility Toolkit's DirectX 8 Functions
    #ifdef ILUT_USE_DIRECTX8
    // ILAPI ILvoid ILAPIENTRY ilutD3D8MipFunc(ILuint NumLevels);
    ILAPI struct IDirect3DTexture8* ILAPIENTRY ilutD3D8Texture(struct IDirect3DDevice8 *Device);
    ILAPI struct IDirect3DVolumeTexture8* ILAPIENTRY ilutD3D8VolumeTexture(struct IDirect3DDevice8 *Device);
    ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFile(struct IDirect3DDevice8 *Device, char *FileName, struct IDirect3DTexture8 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFile(struct IDirect3DDevice8 *Device, char *FileName, struct IDirect3DVolumeTexture8 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFileInMemory(struct IDirect3DDevice8 *Device, ILvoid *Lump, ILuint Size, struct IDirect3DTexture8 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFileInMemory(struct IDirect3DDevice8 *Device, ILvoid *Lump, ILuint Size, struct IDirect3DVolumeTexture8 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromFileHandle(struct IDirect3DDevice8 *Device, ILHANDLE File, struct IDirect3DTexture8 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromFileHandle(struct IDirect3DDevice8 *Device, ILHANDLE File, struct IDirect3DVolumeTexture8 **Texture);
    // These two are not tested yet.
    ILAPI ILboolean ILAPIENTRY ilutD3D8TexFromResource(struct IDirect3DDevice8 *Device, HMODULE SrcModule, char *SrcResource, struct IDirect3DTexture8 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D8VolTexFromResource(struct IDirect3DDevice8 *Device, HMODULE SrcModule, char *SrcResource, struct IDirect3DVolumeTexture8 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D8LoadSurface(struct IDirect3DDevice8 *Device, struct IDirect3DSurface8 *Surface);
    #endif//ILUT_USE_DIRECTX8

    #ifdef ILUT_USE_DIRECTX9
    // ILAPI ILvoid ILAPIENTRY ilutD3D9MipFunc(ILuint NumLevels);
    ILAPI struct IDirect3DTexture9* ILAPIENTRY ilutD3D9Texture (struct IDirect3DDevice9* Device);
    ILAPI struct IDirect3DVolumeTexture9* ILAPIENTRY ilutD3D9VolumeTexture (struct IDirect3DDevice9* Device);
    ILAPI struct IDirect3DCubeTexture9* ILAPIENTRY ilutD3D9CubeTexture (struct IDirect3DDevice9* Device);

    ILAPI ILboolean ILAPIENTRY ilutD3D9CubeTexFromFile(struct IDirect3DDevice9 *Device, char *FileName, struct IDirect3DCubeTexture9 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D9CubeTexFromFileInMemory(struct IDirect3DDevice9 *Device, ILvoid *Lump, ILuint Size, struct IDirect3DCubeTexture9 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D9CubeTexFromFileHandle(struct IDirect3DDevice9 *Device, ILHANDLE File, struct IDirect3DCubeTexture9 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D9CubeTexFromResource(struct IDirect3DDevice9 *Device, HMODULE SrcModule, char *SrcResource, struct IDirect3DCubeTexture9 **Texture);

    ILAPI ILboolean ILAPIENTRY ilutD3D9TexFromFile(struct IDirect3DDevice9 *Device, char *FileName, struct IDirect3DTexture9 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D9VolTexFromFile(struct IDirect3DDevice9 *Device, char *FileName, struct IDirect3DVolumeTexture9 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D9TexFromFileInMemory(struct IDirect3DDevice9 *Device, ILvoid *Lump, ILuint Size, struct IDirect3DTexture9 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D9VolTexFromFileInMemory(struct IDirect3DDevice9 *Device, ILvoid *Lump, ILuint Size, struct IDirect3DVolumeTexture9 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D9TexFromFileHandle(struct IDirect3DDevice9 *Device, ILHANDLE File, struct IDirect3DTexture9 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D9VolTexFromFileHandle(struct IDirect3DDevice9 *Device, ILHANDLE File, struct IDirect3DVolumeTexture9 **Texture);

    // These two are not tested yet.
    ILAPI ILboolean ILAPIENTRY ilutD3D9TexFromResource(struct IDirect3DDevice9 *Device, HMODULE SrcModule, char *SrcResource, struct IDirect3DTexture9 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D9VolTexFromResource(struct IDirect3DDevice9 *Device, HMODULE SrcModule, char *SrcResource, struct IDirect3DVolumeTexture9 **Texture);
    ILAPI ILboolean ILAPIENTRY ilutD3D9LoadSurface(struct IDirect3DDevice9 *Device, struct IDirect3DSurface9 *Surface);
    #endif//ILUT_USE_DIRECTX9
    */


    Je ne sais pas a quoi ca sert, mais au moins je n'ai plus les warnings (c'etait pas des erreurs c'etait des warnings). J'espere ne pas avoir de soucis plus tard a cause de ca.

    Si quelqu'un a une meilleure methode je suis preneur ^^
    Le forum c'est trop génial

  4. #4
    Rédacteur

    Apparemment il faut retirer la définition des macros ILUT_USE_DIRECTX8 et ILUT_USE_DIRECTX9 dans le fichier de configuration (ilut.h ?), puisque tu utilises OpenGL.

  5. #5
    Membre averti
    Je pense qu'en mettant dans mon source a moi
    #define ILUT_USE_DIRECTX8 0
    #define ILUT_USE_DIRECTX9 0

    Et en décommentant le block que j'ai commenté, je pense que ca devrait passer, il verra la valeur a 0, et donc il ignorera le block.
    Je testerai ce soir, je ne suis pas chez moi la
    Le forum c'est trop génial

  6. #6
    Rédacteur

    Non. Il teste si le symbole est défini (#ifdef), pas s'il est différent de zéro (#if xxx != 0). Il faut donc bien retirer sa définition.

  7. #7
    Membre averti
    en effet, j'vais resté avec les parametres
    Le forum c'est trop génial

###raw>template_hook.ano_emploi###