SDL problem: the program hangs before SDL_main

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

Moderators: cheriff, TyRaNiD

Post Reply
deniska
Posts: 71
Joined: Mon Oct 17, 2005 1:38 pm
Location: New York

SDL problem: the program hangs before SDL_main

Post by deniska »

While trying to port an SDL game to PSP I got stock with a weird problem:
The program hangs PSP upon startup (it requires a powerdown to reboot)
It never seems to make it to SDL_main. - at least it did not display/printed out anything from printf()/pspDebugScreenPrintf() and hung even when I exited SDL_main right away (commenting out everything else)


Here is the URL to the source code and the Makefile:
http://deniska.dcemu.co.uk/bin/blobs.tar
Please take a look if you have a few minutes - any help/suggestions would be greatly appreciated.

Thank you in advance,

DENIS
sg57
Posts: 144
Joined: Fri Oct 14, 2005 2:26 pm

Re: SDL problem: the program hangs before SDL_main

Post by sg57 »

deniska wrote:While trying to port an SDL game to PSP I got stock with a weird problem:
The program hangs PSP upon startup (it requires a powerdown to reboot)
It never seems to make it to SDL_main. - at least it did not display/printed out anything from printf()/pspDebugScreenPrintf() and hung even when I exited SDL_main right away (commenting out everything else)


Here is the URL to the source code and the Makefile:
http://deniska.dcemu.co.uk/bin/blobs.tar
Please take a look if you have a few minutes - any help/suggestions would be greatly appreciated.

Thank you in advance,

DENIS
You have your makefile is missing -lsdlmain
deniska
Posts: 71
Joined: Mon Oct 17, 2005 1:38 pm
Location: New York

Post by deniska »

Actally, -lSDLmain is added in the call to sdl-config, so the actual linker call looks like:

Code: Select all

psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -O2  -Wall -g -I/usr/local/p
spdev/psp/include/SDL -Dmain=SDL_main -DVER=1.04 -DRELEASE=1  -L. -L/usr/local/p
spdev/psp/sdk/lib   aquaBoss.o bosses.o bullets.o cutscene.o CAudio.o CBoss.o CC
ollision.o CCutscene.o CData.o CEffect.o CEngine.o CEntity.o CFileData.o CGame.o
 CGameData.o CGameObject.o CGraphics.o CHub.o CKeyboard.o CJoystick.o CLineDef.o
 CList.o CMap.o CMath.o CObjective.o CPak.o CParticle.o CPersistant.o CPersistDa
ta.o CRadarBlip.o CSpawnPoint.o CSprite.o CSwitch.o CTeleporter.o CTrain.o CTrap
.o CWeapon.o CWidget.o droidBoss.o effects.o enemies.o entities.o explosions.o f
inalBattle.o galdov.o game.o graphics.o hub.o info.o init.o intro.o items.o line
Defs.o loadSave.o map.o mapData.o mias.o mission.o objectives.o obstacles.o opti
ons.o particles.o player.o resources.o spawnPoints.o switches.o tankBoss.o telep
orters.o title.o trains.o traps.o triggers.o weapons.o widgets.o main.o -lstdc++
 -lSDL_mixer  -lvorbisidec -lSDL_image  -lpng -lz -ljpeg  -lSDL_ttf -lfreetype -
L/usr/local/pspdev/psp/lib -lSDLmain -lSDL -lm -lGL -L/usr/local/pspdev/psp/sdk/
lib -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprt
c -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lsdlmain -lpspdebug -lpspdi
splay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpsp
net_resolver -lpsputility -lpspuser -lpspkernel -o blob.elf
Any other thoughts? ;-)
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

It's probably crashing in one of your C++ constructors, which would get called before main.
Post Reply