Author Topic: Besoin d'aide pour importation d'objet 3ds ds un prog en C++  (Read 2170 times)

0 Members and 1 Guest are viewing this topic.

kokusho

  • Associate
  • Posts: 1
Bonjour a tous , voila j'ai un probleme avec LynX3dviewer et le tutorial opengl qui explique comment fait. Voila j'arrive pas a compiler le prog du tutorial il me met ca a chaque fois :

Linking executable: C:\Documents and Settings\Propriétaire\Mes documents\tut14_ogl\Release\tut14_ogl.exe
Release\teapot.o:teapot.c:(.data+0x0): multiple definition of `materialsList'
Release\cmesh.o:cmesh.cpp:(.data+0x0): first defined here
Release\teapot.o:teapot.c:(.data+0x1a0): multiple definition of `meshesList'
Release\cmesh.o:cmesh.cpp:(.data+0x1a0): first defined here
Release\teapot.o:teapot.c:(.data+0x4240): multiple definition of `verticesList_64'
Release\cmesh.o:cmesh.cpp:(.data+0x4240): first defined here
Release\teapot.o:teapot.c:(.data+0x240): multiple definition of `facesList_64'
Release\cmesh.o:cmesh.cpp:(.data+0x240): first defined here
Release\ctexture.o:ctexture.cpp:(.text+0x2e): undefined reference to `_imp__ilInit'
Release\ctexture.o:ctexture.cpp:(.text+0x34): undefined reference to `_imp__iluInit'
Release\ctexture.o:ctexture.cpp:(.text+0x41): undefined reference to `_imp__ilEnable'
Release\ctexture.o:ctexture.cpp:(.text+0x4e): undefined reference to `_imp__ilOriginFunc'
Release\ctexture.o:ctexture.cpp:(.text+0x5b): undefined reference to `_imp__ilEnable'
Release\ctexture.o:ctexture.cpp:(.text+0x68): undefined reference to `_imp__ilTypeFunc'
Release\ctexture.o:ctexture.cpp:(.text+0x75): undefined reference to `_imp__ilEnable'
Release\ctexture.o:ctexture.cpp:(.text+0x82): undefined reference to `_imp__ilFormatFunc'
Release\ctexture.o:ctexture.cpp:(.text+0x8f): undefined reference to `_imp__ilutRenderer'
Release\ctexture.o:ctexture.cpp:(.text+0xaa): undefined reference to `_imp__ilGenImages'
Release\ctexture.o:ctexture.cpp:(.text+0xb6): undefined reference to `_imp__ilBindImage'
Release\ctexture.o:ctexture.cpp:(.text+0xfe): undefined reference to `_imp__ilInit'
Release\ctexture.o:ctexture.cpp:(.text+0x104): undefined reference to `_imp__iluInit'
Release\ctexture.o:ctexture.cpp:(.text+0x111): undefined reference to `_imp__ilEnable'
Release\ctexture.o:ctexture.cpp:(.text+0x11e): undefined reference to `_imp__ilOriginFunc'
Release\ctexture.o:ctexture.cpp:(.text+0x12b): undefined reference to `_imp__ilEnable'
Release\ctexture.o:ctexture.cpp:(.text+0x138): undefined reference to `_imp__ilTypeFunc'
Release\ctexture.o:ctexture.cpp:(.text+0x145): undefined reference to `_imp__ilEnable'
Release\ctexture.o:ctexture.cpp:(.text+0x152): undefined reference to `_imp__ilFormatFunc'
Release\ctexture.o:ctexture.cpp:(.text+0x15f): undefined reference to `_imp__ilutRenderer'
Release\ctexture.o:ctexture.cpp:(.text+0x17a): undefined reference to `_imp__ilGenImages'
Release\ctexture.o:ctexture.cpp:(.text+0x186): undefined reference to `_imp__ilBindImage'
Release\ctexture.o:ctexture.cpp:(.text+0x1b3): undefined reference to `_imp__ilBindImage'
Release\ctexture.o:ctexture.cpp:(.text+0x31c): undefined reference to `_imp__ilLoadImage'
Release\ctexture.o:ctexture.cpp:(.text+0x360): undefined reference to `_imp__ilGetInteger'
Release\ctexture.o:ctexture.cpp:(.text+0x370): undefined reference to `_imp__ilGetInteger'
Release\ctexture.o:ctexture.cpp:(.text+0x380): undefined reference to `_imp__ilGetInteger'
Release\ctexture.o:ctexture.cpp:(.text+0x446): undefined reference to `_imp__ilCopyPixels'


Je travail sous code block ..... et ce que je cherche a faire c'est inserer un objet 3ds dans le main de mon prog ...
Si queqlu'un a queqlue chose de plus simple que le tuto merci, ou si vous pouvez m'expliquer pourquoi j'ai ce probleme je suis preneur.

JeGX

  • Global Moderator
  • Capo Crimine
  • *****
  • Posts: 2357
    • oZone3D.Net
Besoin d'aide pour importation d'objet 3ds ds un prog en C++
« Reply #1 on: May 26, 2006, 10:09:38 AM »
Sous Visual C++ ca compile sans pb. Maintenant poour CodeBlock je ne sais pas. Mais voila quelques pistes:

1 - ajoute une protection contre les inclusions mutiples dans le fichier teapot.c comme ceci:
Code: [Select]

//Debut du fichier.
#ifndef TEAPOT_C_H
#define TEAPOT_C_H

//
// Code du fichier
//


//Fin du fichier
#endif

Je pense que cela evitera les "multiple definition of `materialsList' "...

2 -  Pour les  undefined reference to `_imp__ilInit'  tu dois préciser à ton compilateur le chemin vers les lib de DevIL. Sous Visual C++, la directive
Code: [Select]

#pragma comment(lib, "IL/devil.lib")

permet de le faire sans toucher aux settings du compilo. Fais les adaptations dans ton cas. Mais as tu besoin de la DevIL dans ton prog?