Forums GAMERGEN

[PROB]Compilation impossible à cause de la libm[RESOLU]

Règles du forum
Pour les tutoriels liés au jailbreak de votre console. Merci de consulter l'univers undeground Wii.

Cette section reste soumise aux règles du forum, aucun contenu warez, illégal et dangereux n'est toléré.

[PROB]Compilation impossible à cause de la libm[RESOLU]

Message non lupar valentintintin » 22 Fév 2010, 18:24

Bonjour, J'ai posté mon problème sur devsgen mais il n'y a pas u de réponse, donc voici mon problème: je n'arrive pas à compiler mon code sur WII en C.

Le voila:
C'est un code PC que j'ai porté sur WII.

[+] CLIQUER POUR AFFICHER
Code: Select All Code
//les includes
#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_ttf.h>
#include <gccore.h>
#include <ogcsys.h>
#include <unistd.h>
#include <wiiuse/wpad.h>

//les défines des formes
#define sur_rien 0
#define sur_carre 1
#define sur_triangle 2

int main(int argc, char *argv[])  //fonction principal
{
        SDL_Event event;  //la variables des évènements

SDL_Surface *ecran;  //l'écran

SDL_Surface *carre, *triangle, *etoile, *rond, *hexagone, *pentagone; //les formes  à placer

SDL_Surface *carre2, *triangle2, *etoile2, *rond2, *hexagone2, *pentagone2; //les formes support

//le positionement des formes à placer
SDL_Rect p_carre, p_triangle, p_etoile, p_rond, p_hexagone, p_pentagone;

//le positionement des formes suport
SDL_Rect p_carre2, p_triangle2, p_etoile2, p_rond2, p_hexagone2, p_pentagone2;

int niveau = 1;  //variables des niveaux

int prit = 0;  //pour savoir lequel est prit

int arret = 1; //variable de la boucle pour l'arret

int point = 0; //ba oui les points très importants!!

u32 pressed;  //variable des boutons

   SDL_Init(SDL_INIT_VIDEO);  //initialise sdl

   ecran = SDL_SetVideoMode(480, 272, 32, SDL_HWSURFACE | SDL_DOUBLEBUF);  //init l'écran

   //eface l'écran en blanc
   SDL_FillRect(ecran, NULL, SDL_MapRGB(ecran->format, 255, 255, 255));

   //les formes à placer
   carre = IMG_Load("img/a placer/jeu 1/carre2.gif");
   triangle = IMG_Load("img/a placer/jeu 1/triangle2.gif");

   //les formes suport
   carre2 = IMG_Load("img/support/jeu 1/carre.gif");
   triangle2 = IMG_Load("img/support/jeu 1/triangle.gif");

   //les positions des formes à placer
   p_carre.x = 0; 
   p_carre.y = 0;
   p_triangle.x = 80;
   p_triangle.y = 0;

   //les positions des formes support
   p_carre2.x = 0;
   p_carre2.y = 195;
   p_triangle2.x = 180;
   p_triangle2.y = 195;

   //boucle infinie
   while(arret)
   {
      WPAD_ScanPads();
      SDL_WaitEvent(&event);
      switch (event.type) //les évènements
      {
      case SDL_QUIT:   //pour quitter
         arret = 0;
         break;
      }
      
      switch (pressed)
      {
      case WPAD_BUTTON_B:   //si il appuie sur b
         switch (prit)
         {
         case sur_carre: 
            if (event.button.x >= p_carre2.x && event.button.x <= p_carre2.x + 72 && event.button.y <= p_carre2.y + 72 && event.button.y >= p_carre2.y) point++;
            break;
            
         case sur_triangle:
            if (event.button.x >= p_triangle2.x && event.button.x <= p_triangle2.x + 78 && event.button.y <= p_triangle2.y + 76&& event.button.y >= p_triangle.y) point++;
            break;
         }
         prit = 0;
         break;

      case WPAD_BUTTON_A:  //si il appui sur a
         if (event.button.x >= p_carre.x && event.button.x <= p_carre.x + 72 && event.button.y <= p_carre.y + 72 && event.button.y >= p_carre.y) prit = sur_carre;
         if (event.button.x >= p_triangle.x && event.button.x <= p_triangle.x + 68 && event.button.y <= p_triangle.y + 68 && event.button.y >= p_triangle.y) prit = sur_triangle;
         break;
      }

      switch (niveau)  //les niveau
      {
      case 1:  //niveau 1
         //eface l'écran en blanc
         SDL_FillRect(ecran, NULL, SDL_MapRGB(ecran->format, 255, 255, 255));
         SDL_BlitSurface(carre2, NULL, ecran, &p_carre2); //afiche le carre support
         SDL_BlitSurface(triangle2, NULL, ecran, &p_triangle2); //afiche le carre support
         SDL_BlitSurface(carre, NULL, ecran, &p_carre);  //afiche le carre a placer
         SDL_BlitSurface(triangle, NULL, ecran, &p_triangle);  //afiche le carre a placer
         break;
      }

      switch (prit) //les forme  cliquer
      {
      case sur_carre:
         p_carre.x = event.motion.x;
         p_carre.y = event.motion.y;
         break;

      case sur_triangle:
         p_triangle.x = event.motion.x;
         p_triangle.y = event.motion.y;
         break;
      }

      if (point == 2) exit(0);
      //met a jour l'écran
      SDL_Flip(ecran);   
   }

   //eface de la mémoire les formes
   SDL_FreeSurface(carre);
   SDL_FreeSurface(triangle);
   SDL_FreeSurface(carre2);
   SDL_FreeSurface(triangle2);

   //quitte sdl
   SDL_Quit();

   //fin !!!!!!!!
   return EXIT_SUCCESS;
}



Le makefile:

[+] CLIQUER POUR AFFICHER
Code: Select All Code
#---------------------------------------------------------------------------------
# Clear the implicit built in rules
#---------------------------------------------------------------------------------
.SUFFIXES:
#---------------------------------------------------------------------------------
ifeq ($(strip $(DEVKITPPC)),)
$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>devkitPPC)
endif

include $(DEVKITPPC)/wii_rules

#---------------------------------------------------------------------------------
# TARGET is the name of the output
# BUILD is the directory where object files & intermediate files will be placed
# SOURCES is a list of directories containing source code
# INCLUDES is a list of directories containing extra header files
#---------------------------------------------------------------------------------
TARGET      :=   boot
BUILD      :=   build
SOURCES      :=   source
DATA      :=   data 
INCLUDES   :=

#---------------------------------------------------------------------------------
# options for code generation
#---------------------------------------------------------------------------------

CFLAGS      =   -g -Os -Wall $(MACHDEP) $(INCLUDE)
CXXFLAGS   =   $(CFLAGS)

# TODO: use a base address in MEM2 to avoid overlaps while relocating
#LDFLAGS      =   -g $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.header=0x91000000

LDFLAGS      =   -g $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.header=0x80a00000

#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lSDL_mixer -lsmpeg -lSDL_image -lSDL_net -lSDL -lpng -ljpeg -lz -lwiiuse -lfat -lbte -logc -lfreetype -lwiikeyboard

#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
# include and lib
#---------------------------------------------------------------------------------
LIBDIRS   :=

#---------------------------------------------------------------------------------
# no real need to edit anything past this point unless you need to add additional
# rules for different file extensions
#---------------------------------------------------------------------------------
ifneq ($(BUILD),$(notdir $(CURDIR)))
#---------------------------------------------------------------------------------

export OUTPUT   :=   $(CURDIR)/$(TARGET)

export VPATH   :=   $(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
               $(foreach dir,$(DATA),$(CURDIR)/$(dir))

export DEPSDIR   :=   $(CURDIR)/$(BUILD)

#---------------------------------------------------------------------------------
# automatically build a list of object files for our project
#---------------------------------------------------------------------------------
CFILES      :=   $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES   :=   $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
sFILES      :=   $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
SFILES      :=   $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
BINFILES   :=   $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))

#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
   export LD   :=   $(CC)
else
   export LD   :=   $(CXX)
endif

export OFILES   :=   $(addsuffix .o,$(BINFILES)) \
               $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
               $(sFILES:.s=.o) $(SFILES:.S=.o)

#---------------------------------------------------------------------------------
# build a list of include paths
#---------------------------------------------------------------------------------
export INCLUDE   :=   $(foreach dir,$(INCLUDES), -iquote $(CURDIR)/$(dir)) \
               $(foreach dir,$(LIBDIRS),-I$(dir)/include) \
               -I$(CURDIR)/$(BUILD) \
               -I$(LIBOGC_INC)

#---------------------------------------------------------------------------------
# build a list of library paths
#---------------------------------------------------------------------------------
export LIBPATHS   :=   $(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
               -L$(LIBOGC_LIB)

export OUTPUT   :=   $(CURDIR)/$(TARGET)
.PHONY: $(BUILD) clean

#---------------------------------------------------------------------------------
$(BUILD):
   @[ -d $@ ] || mkdir -p $@
   @$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile

#---------------------------------------------------------------------------------
clean:
   @echo clean ...
   @rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).dol

#---------------------------------------------------------------------------------
else

DEPENDS   :=   $(OFILES:.o=.d)

#---------------------------------------------------------------------------------
# main targets
#---------------------------------------------------------------------------------
$(OUTPUT).dol: $(OUTPUT).elf
$(OUTPUT).elf: $(OFILES)

#---------------------------------------------------------------------------------

-include $(DEPENDS)

#---------------------------------------------------------------------------------
endif
#---------------------------------------------------------------------------------



Et voila l'erreur:

Code: Select All Code

template.c
linking ... boot.elf
d:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/4.4.2/../../../../powerpc-eabi/lib\libm.a(lib_a-s_atangent.o): In function `atangent':
(.text.atangent+0x224): undefined reference to `__errno'
d:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/4.4.2/../../../../powerpc-eabi/lib\libm.a(lib_a-s_fabs.o): In function `fabs':
(.text.fabs+0x7c): undefined reference to `__errno'
d:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/4.4.2/../../../../powerpc-eabi/lib\libm.a(lib_a-s_fabs.o): In function `fabs':
(.text.fabs+0xa0): undefined reference to `__errno'
d:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/4.4.2/../../../../powerpc-eabi/lib\libm.a(lib_a-s_frexp.o): In function `frexp':
(.text.frexp+0x84): undefined reference to `__errno'
d:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/4.4.2/../../../../powerpc-eabi/lib\libm.a(lib_a-s_pow.o): In function `pow':
(.text.pow+0x174): undefined reference to `__errno'
d:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/4.4.2/../../../../powerpc-eabi/lib\libm.a(lib_a-s_pow.o):(.text.pow+0x1b8): more undefined references to `__errno' follow
collect2: ld returned 1 exit status
make[1]: *** [/d/devkitPro/home/wii/test_sdl/boot.elf] Error 1
"make": *** [build] Error 2


Si vous pouvez m'aider MERCI!!!!

@slt
Dernière édition par jag011 le 18 Oct 2010, 22:06, édité 1 fois.
valentintintin Gamer Débutant
Messages: 8
Inscription: 21 Juin 2011, 08:39
Prénom: valentin
Pays: France
Sexe: Homme

Re: [PROB]Compilation impossible à cause de la libm

Message non lupar Linkdu64 » 27 Fév 2010, 12:49

Je pence que t'as fait des fautes de frappes (2), mais je ne mis connait pas assai pour te dir où.

Bonne chance et il sert a quoi ton hombrew ?
Linkdu64 Gamer Pro
Gamer Pro
Messages: 108
Inscription: 15 Juil 2010, 14:44
Prénom: Maxime
Pays: France

Re: [PROB]Compilation impossible à cause de la libm

Message non lupar valentintintin » 27 Fév 2010, 14:23

Le code marche bien sur PC, c'est peut-être dans le makefile avec la lib sdl_image.

Mon homebrew est pour mon petit frère de 3ans: il doit s'amuser à replacer des formes sur d'autres.
valentintintin Gamer Débutant
Messages: 8
Inscription: 21 Juin 2011, 08:39
Prénom: valentin
Pays: France
Sexe: Homme

Re: [PROB]Compilation impossible à cause de la libm

Message non lupar JeanMi59226 » 27 Fév 2010, 14:28

Mp Téton ou Arasiuim, il pourront te répondre, c'est les développeurs de Sciifii
Iphone 3g 4.1.3 x2 Jail. et ultrasnow , iphone 4 7.1.2 , Ipad2 8.3., appletv 2, Iphone 5S 8.3, iPhone 5 x3 8.3 Ipod touch 5G 8.3, Iphone 6 128GB , Ps3 slim ( déban IDPS PROJ3CT) et super slim OFW , Wii x2 4.3 Sciifii, PS4 500GO, IPhone 7 128GB
Avatar de l’utilisateur JeanMi59226 Ancien
Ancien
Messages: 10192
Inscription: 23 Juil 2010, 17:07
Prénom: Jean michel
Pays: France
Sexe: Homme

Re: [PROB]Compilation impossible à cause de la libm

Message non lupar JustR » 01 Mar 2010, 00:06

Salut,

On dirait qu'il ne trouve pas le fichier libm.a !!!
peut être du au fait que tu n'aie que des slash pour les divers dossier sauf juste avant ta librairie ou c'est un anti-slash:
d:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/4.4.2/../../../../powerpc-eabi/lib\libm.a
JustR Gamer Averti
Gamer Averti
Messages: 99
Inscription: 21 Fév 2010, 23:55
Pays: France
Sexe: Homme

Re: [PROB]Compilation impossible à cause de la libm

Message non lupar valentintintin » 01 Mar 2010, 14:17

Moi aussi j'ai l'impression qu'il ne la trouve pas.

Je ne sais pas pour l'antislash.
valentintintin Gamer Débutant
Messages: 8
Inscription: 21 Juin 2011, 08:39
Prénom: valentin
Pays: France
Sexe: Homme

Re: [PROB]Compilation impossible à cause de la libm

Message non lupar arasium » 12 Aoû 2010, 08:31

Si si il a trouve libm. Par contre il te manque une autre lib, celle ou il y a __errno.
arasium Gamer Argent
Gamer Argent
Messages: 2863
Inscription: 09 Juin 2010, 09:05
Pays: France


 

Retourner vers Entraide et dépannage