Sudden compiling error

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
8HandsCoder
Posts: 2
Joined: Tue Feb 21, 2006 8:12 pm

Sudden compiling error

Post by 8HandsCoder »

Hi, this is my first post so I'm going to introduce myself and my project a little. First its '8HandsCoder' because we'll be 4 behind this nickname as it might make it easier for us. Our project is to create a homebrew of SpiraClock
a new kind of agenda : our development is at the stage at which we have SpiraClock running on the PSP except that, recently, as we tried to add meeting exchange via irda, an error suddently appeared. An error, I don't understand and which I can't find any reason for in the modifications we made.
  • PSPiral.o(.bss+0x0) : multiple definition of '__packed__'
    main.o(.bss+0x0) : first defined here
    DisplayManager.o(.bss+0x0) : multiple definition of '__packed__'
    main.o(.bss+0x0) : first defined here
    MainMenu.o(.bss+0x0) : multiple definition of '__packed__'
    main.o(.bss+0x0) : first defined here
    TransferMenu.o(.bss+0x0) : multiple definition of '__packed__'
    main.o(.bss+0x0) : first defined here
Below are the headers of the classes concerned and the makefile.. tell me if you need some more info to solve what is for me a total mystery. ;)
  • TARGET = sdl_ose
    PSPSDK=$(shell psp-config --pspsdk-path)
    PSPBIN = $(PSPSDK)/../bin
    SDL_CONFIG = $(PSPBIN)/sdl-config

    OBJS = main.o PSPiral.o DisplayManager.o MainMenu.o TransfertMenu.o Modules.o Spiral.o PolarPoint.o reader.o evtlist.o evt.o

    INCDIR =
    CFLAGS = -O2 -G0 -Wall $(shell $(SDL_CONFIG) --cflags) -DHAVE_CONFIG_H
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti -Wpointer-arith
    ASFLAGS = $(CFLAGS)

    LIBDIR =
    LDFLAGS =
    LIBS = -lstdc++ -lSDL_mixer -lSDL_image -lSDL_gfx -lpng -lz -ljpeg \
    -lm $(shell $(SDL_CONFIG) --libs)

    EXTRA_TARGETS = EBOOT.PBP
    PSP_EBOOT_TITLE = PSPiral

    include $(PSPSDK)/lib/build.mak

Code: Select all

#include "..\include\PSPiral.h"
#ifndef PSP
int main( int argc, char *argv[] )
#else
extern "C" int SDL_main( int argc, char *argv[] )
#endif
{
	PSPiral theAppli=  PSPiral();
	return 0;
}

Code: Select all

#ifndef SPIRAL_H
#define SPIRAL_H

#include "TransfertMenu.h"
#include "MainMenu.h"
#include "DisplayManager.h"

class PSPiral
{
private :
	Modules * currentModule;	

	DisplayManager * theClock;
	MainMenu * mainMenu;
	TransfertMenu * transmissionMenu;

public:
	PSPiral();
	~PSPiral();
	void changeCurrentModuleTo(int typeOfMenu){};
};
#endif

Code: Select all

#ifndef DISPLAYMANAGER_H
#define DISPLAYMANAGER_H

#include "Spiral.h"
#include "modules.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using std&#58;&#58;string;

class DisplayManager &#58; public Modules
&#123;

	private&#58;

		bool optiActivated;
		Evt currentTime;
		Evt middleTime;
		bool selectHourArm;
		bool selectMinuteArm;
		
		Spiral theSpiral;
				
	public&#58;
		DisplayManager&#40;char * ref&#41;;
		~DisplayManager&#40;void&#41;;
		//Drawing methods
		void drawEvent&#40;Evt &anEvent&#41;;//draw an event
		void drawCurrentRef&#40;&#41;;//draw the arm of the clock
		void drawScene&#40;&#41;;//draw the agenda
		void transitionToMainMenu&#40;&#41;;
		int eventLoop&#40;&#41;;

&#125;;
#endif

Code: Select all

#ifndef MAINMENU_H
#define MAINMENU_H

#include "modules.h"
#include <stdio.h>
#include <stdlib.h>
class MainMenu &#58;public Modules
&#123;
public&#58;
	
	int optionSelected;//1=clock 2=transmit
	
	MainMenu&#40;SDL_Surface *screen,const SDL_VideoInfo *info,Uint8  video_bpp,Uint32 videoflags&#41;;
	MainMenu&#40;void&#41;&#123;&#125;;
	~MainMenu&#40;void&#41;;
	void drawHighliter&#40;&#41;;
	void drawScene&#40;&#41;;//draw the agenda
	void transitionFromMainMenu&#40;&#41;&#123;&#125;;
	void transitionToMainMenu&#40;&#41;&#123;&#125;;
	int SDLInitiation&#40;&#41;;
	int eventLoop&#40;&#41;;
&#125;;
#endif

Code: Select all

#ifndef MAINMENU_H
#define MAINMENU_H

#include "modules.h"
#include <stdio.h>
#include <stdlib.h>
class MainMenu &#58;public Modules
&#123;
public&#58;
	
	int optionSelected;//1=clock 2=transmit
	
	MainMenu&#40;SDL_Surface *screen,const SDL_VideoInfo *info,Uint8  video_bpp,Uint32 videoflags&#41;;
	MainMenu&#40;void&#41;&#123;&#125;;
	~MainMenu&#40;void&#41;;
	void drawHighliter&#40;&#41;;
	void drawScene&#40;&#41;;//draw the agenda
	void transitionFromMainMenu&#40;&#41;&#123;&#125;;
	void transitionToMainMenu&#40;&#41;&#123;&#125;;
	int SDLInitiation&#40;&#41;;
	int eventLoop&#40;&#41;;
&#125;;
#endif
8HandsCoder
Posts: 2
Joined: Tue Feb 21, 2006 8:12 pm

Post by 8HandsCoder »

After a long search it seems to be that this kind of problem usually occurs :
-with DevCpp and that an update solves the problem
-with badly built libraries
so, I kinda concluded that there's a conflict between __packed__ defined in both SDL_gfx and pspsircs libraries... but I couldn't find any solution to that.
If anyone as another lead to give me on diagnosticing the problem or finding a solution to it I would be very grateful.
Post Reply